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.
1 parent 602148c commit dfeecf5Copy full SHA for dfeecf5
lsp/foam_ls.lua
@@ -13,10 +13,17 @@ return {
13
filetypes = { 'foam', 'OpenFOAM' },
14
root_dir = function(bufnr, on_dir)
15
local fname = vim.api.nvim_buf_get_name(bufnr)
16
- on_dir(vim.iter(vim.fs.parents(fname)):find(function(path)
17
- if vim.uv.fs_stat(path .. '/system/controlDict') then
18
- return path
+ for path in vim.fs.parents(fname) do
+ if vim.uv.fs_stat(path .. "/system/controlDict") then
+ on_dir(path)
19
+ return
20
end
- end))
21
+ end
22
+ local git_root = vim.fs.root(bufnr, { ".git" })
23
+ if git_root then
24
+ on_dir(git_root)
25
26
27
+ on_dir(vim.fs.dirname(fname))
28
end,
29
}
0 commit comments