We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
lspconfig.util
1 parent ca1b8c5 commit e8b9bbfCopy full SHA for e8b9bbf
lsp/solc.lua
@@ -4,13 +4,18 @@
4
---
5
--- solc is the native language server for the Solidity language.
6
7
-local util = require 'lspconfig.util'
8
-
9
return {
10
cmd = { 'solc', '--lsp' },
11
filetypes = { 'solidity' },
12
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))
+ on_dir(vim.fs.root(bufnr, function(name, _)
+ local patterns = { 'hardhat.config.*', '.git' }
+ for _, pattern in ipairs(patterns) do
+ if vim.glob.to_lpeg(pattern):match(name) ~= nil then
15
+ return true
16
+ end
17
18
+ return false
19
+ end))
20
end,
21
}
0 commit comments