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 41168c6 commit 9c4e003Copy full SHA for 9c4e003
lsp/ols.lua
@@ -4,13 +4,18 @@
4
---
5
--- `Odin Language Server`.
6
7
-local util = require 'lspconfig.util'
8
-
9
return {
10
cmd = { 'ols' },
11
filetypes = { 'odin' },
12
root_dir = function(bufnr, on_dir)
13
- local fname = vim.api.nvim_buf_get_name(bufnr)
14
- on_dir(util.root_pattern('ols.json', '.git', '*.odin')(fname))
+ on_dir(vim.fs.root(bufnr, function(name, _)
+ local patterns = { 'ols.json', '.git', '*.odin' }
+ 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