diff options
| -rw-r--r-- | doc/server_configurations.md | 68 | ||||
| -rw-r--r-- | doc/server_configurations.txt | 68 |
2 files changed, 136 insertions, 0 deletions
diff --git a/doc/server_configurations.md b/doc/server_configurations.md index 727461c2..31811a89 100644 --- a/doc/server_configurations.md +++ b/doc/server_configurations.md @@ -138,6 +138,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [solang](#solang) - [solargraph](#solargraph) - [solc](#solc) +- [solidity](#solidity) - [solidity_ls](#solidity_ls) - [sorbet](#sorbet) - [sourcekit](#sourcekit) @@ -5796,6 +5797,73 @@ require'lspconfig'.solc.setup{} ``` +## solidity + +https://github.com/qiuxiang/solidity-ls + +npm i solidity-ls -g + +Make sure that solc is installed and it's the same version of the file. solc-select is recommended. + +Solidity language server is a LSP with autocomplete, go to definition and diagnostics. + +If you use brownie, use this root_dir: +root_dir = util.root_pattern('brownie-config.yaml', '.git') + +on includePath, you can add an extra path to search for external libs, on remapping you can remap lib <> path, like: + +```lua +{ solidity = { includePath = '/Users/your_user/.brownie/packages/', remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' } } } +``` + +**For brownie users** +Change the root_dir to: + +```lua +root_pattern("brownie-config.yaml", ".git") +``` + +The best way of using it is to have a package.json in your project folder with the packages that you will use. +After installing with package.json, just create a `remappings.txt` with: + +``` +@OpenZeppelin/=node_modules/OpenZeppelin/openzeppelin-contracts@4.6.0/ +``` + +You can omit the node_modules as well. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + - `settings` : + ```lua + { + solidity = { + includePath = "", + remapping = {} + } + } + ``` + + ## solidity_ls npm install -g solidity-language-server diff --git a/doc/server_configurations.txt b/doc/server_configurations.txt index 727461c2..31811a89 100644 --- a/doc/server_configurations.txt +++ b/doc/server_configurations.txt @@ -138,6 +138,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [solang](#solang) - [solargraph](#solargraph) - [solc](#solc) +- [solidity](#solidity) - [solidity_ls](#solidity_ls) - [sorbet](#sorbet) - [sourcekit](#sourcekit) @@ -5796,6 +5797,73 @@ require'lspconfig'.solc.setup{} ``` +## solidity + +https://github.com/qiuxiang/solidity-ls + +npm i solidity-ls -g + +Make sure that solc is installed and it's the same version of the file. solc-select is recommended. + +Solidity language server is a LSP with autocomplete, go to definition and diagnostics. + +If you use brownie, use this root_dir: +root_dir = util.root_pattern('brownie-config.yaml', '.git') + +on includePath, you can add an extra path to search for external libs, on remapping you can remap lib <> path, like: + +```lua +{ solidity = { includePath = '/Users/your_user/.brownie/packages/', remapping = { ["@OpenZeppelin/"] = 'OpenZeppelin/openzeppelin-contracts@4.6.0/' } } } +``` + +**For brownie users** +Change the root_dir to: + +```lua +root_pattern("brownie-config.yaml", ".git") +``` + +The best way of using it is to have a package.json in your project folder with the packages that you will use. +After installing with package.json, just create a `remappings.txt` with: + +``` +@OpenZeppelin/=node_modules/OpenZeppelin/openzeppelin-contracts@4.6.0/ +``` + +You can omit the node_modules as well. + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.solidity.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "solidity-ls", "--stdio" } + ``` + - `filetypes` : + ```lua + { "solidity" } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", ".git") + ``` + - `settings` : + ```lua + { + solidity = { + includePath = "", + remapping = {} + } + } + ``` + + ## solidity_ls npm install -g solidity-language-server |
