Skip to content

Commit a7303d0

Browse files
committed
feat(solc): do not use lspconfig.util
1 parent a0185e9 commit a7303d0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lsp/solc.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
---
55
--- solc is the native language server for the Solidity language.
66

7-
local util = require 'lspconfig.util'
8-
97
return {
108
cmd = { 'solc', '--lsp' },
119
filetypes = { 'solidity' },
1210
root_dir = function(bufnr, on_dir)
13-
local fname = vim.api.nvim_buf_get_name(bufnr)
14-
on_dir(util.root_pattern('hardhat.config.*', '.git')(fname))
11+
on_dir(vim.fs.root(bufnr, function(name, _)
12+
local patterns = { 'hardhat.config.*', '.git' }
13+
for _, pattern in ipairs(patterns) do
14+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
15+
return true
16+
end
17+
end
18+
return false
19+
end))
1520
end,
1621
}

0 commit comments

Comments
 (0)