aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/server_configurations/solc.lua
diff options
context:
space:
mode:
authorSebastian Stammler <stammler.s@gmail.com>2022-08-25 01:07:54 +0200
committerGitHub <noreply@github.com>2022-08-25 07:07:54 +0800
commitf40846954bba78ee7dc17fcbe534d523a951bc60 (patch)
treec579a828f68cd7def00307d86b997b631be4608b /lua/lspconfig/server_configurations/solc.lua
parentfix: LspStop should be only stop the current buffer servers by default (#2082) (diff)
downloadnvim-lspconfig-f40846954bba78ee7dc17fcbe534d523a951bc60.tar
nvim-lspconfig-f40846954bba78ee7dc17fcbe534d523a951bc60.tar.gz
nvim-lspconfig-f40846954bba78ee7dc17fcbe534d523a951bc60.tar.bz2
nvim-lspconfig-f40846954bba78ee7dc17fcbe534d523a951bc60.tar.lz
nvim-lspconfig-f40846954bba78ee7dc17fcbe534d523a951bc60.tar.xz
nvim-lspconfig-f40846954bba78ee7dc17fcbe534d523a951bc60.tar.zst
nvim-lspconfig-f40846954bba78ee7dc17fcbe534d523a951bc60.zip
feat(solc): Add hardhat.config.* to solc root detection (#2085)
Hardhat users will experience a better root dir detection if the hardhat.config.ts (or .js) file takes precedence over the git repo dir, especially in monorepos, where this could lead to faulty import statements. Note that most Solidity projects are using hardhat.
Diffstat (limited to 'lua/lspconfig/server_configurations/solc.lua')
-rw-r--r--lua/lspconfig/server_configurations/solc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/lspconfig/server_configurations/solc.lua b/lua/lspconfig/server_configurations/solc.lua
index 42e44fe3..9ae3948d 100644
--- a/lua/lspconfig/server_configurations/solc.lua
+++ b/lua/lspconfig/server_configurations/solc.lua
@@ -4,7 +4,7 @@ return {
default_config = {
cmd = { 'solc', '--lsp' },
filetypes = { 'solidity' },
- root_dir = util.root_pattern '.git',
+ root_dir = util.root_pattern('hardhat.config.*', '.git'),
},
docs = {
description = [[
@@ -13,7 +13,7 @@ https://docs.soliditylang.org/en/latest/installing-solidity.html
solc is the native language server for the Solidity language.
]],
default_config = {
- root_dir = [[root_pattern(".git")]],
+ root_dir = [[root_pattern('hardhat.config.*', '.git')]],
},
},
}