This language server has no error tolerance. Means that some features will only work if sources are no syntax error.
For example:
// should not work
msg.
^
// should work
msg.;
^
- completion
- rename
- signature help (basic implementation)
- go to references
- go to definition
npm i solidity-ls -g
solidity-ls --stdio
or
npx solidity-ls --stdio
:CocInstall coc-solidity
More info: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#solidity
local lspconfig = require 'lspconfig'
lspconfig.solidity.setup({
-- on_attach = on_attach, -- probably you will need this.
-- capabilities = capabilities,
settings = {
-- example of global remapping
solidity = {
includePath = '',
remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' },
-- Array of paths to pass as --allow-paths to solc
allowPaths = {}
}
},
})
run forge remappings > remappings.txt
in project root.