diff options
Diffstat (limited to 'lua/nvim_lsp/zls.lua')
| -rw-r--r-- | lua/nvim_lsp/zls.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/nvim_lsp/zls.lua b/lua/nvim_lsp/zls.lua index 8e91bc8e..5f5742f7 100644 --- a/lua/nvim_lsp/zls.lua +++ b/lua/nvim_lsp/zls.lua @@ -5,7 +5,9 @@ configs.zls = { default_config = { cmd = {"zls"}; filetypes = {"zig", "zir"}; - root_dir = util.root_pattern("zls.json", ".git", "."); + root_dir = function(fname) + return util.root_pattern("zls.json", ".git")(fname) or util.path.dirname(fname) + end }; docs = { description = [[ @@ -14,7 +16,7 @@ configs.zls = { `Zig LSP implementation + Zig Language Server`. ]]; default_config = { - root_dir = [[util.root_pattern("zls.json", ".git") or cwd]]; + root_dir = [[util.root_pattern("zls.json", ".git") or current_file_dirname]]; }; }; }; |
