We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
lspconfig.util
1 parent 2ab9b9e commit 9f21483Copy full SHA for 9f21483
1 file changed
lsp/nimls.lua
@@ -8,15 +8,18 @@
8
--- nimble install nimlsp
9
--- ```
10
11
-local util = require 'lspconfig.util'
12
-
13
return {
14
cmd = { 'nimlsp' },
15
filetypes = { 'nim' },
16
root_dir = function(bufnr, on_dir)
17
- local fname = vim.api.nvim_buf_get_name(bufnr)
18
- on_dir(
19
- util.root_pattern '*.nimble'(fname) or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1])
20
- )
+ on_dir(vim.fs.root(bufnr, function(name, _)
+ local patterns = { '*.nimble', '.git' }
+ for _, pattern in ipairs(patterns) do
+ if vim.glob.to_lpeg(pattern):match(name) ~= nil then
+ return true
+ end
21
22
+ return false
23
+ end))
24
end,
25
}
0 commit comments