diff options
| author | Ogromny <ogromnycoding@gmail.com> | 2020-09-24 13:05:33 +0200 |
|---|---|---|
| committer | Ogromny <ogromnycoding@gmail.com> | 2020-09-24 13:05:33 +0200 |
| commit | 168c4d0c178f040c81111ec168217353dc901214 (patch) | |
| tree | f98e2f98075665248db1ebf91fb898cdcbb5bd03 /lua/nvim_lsp | |
| parent | [ZLS] initial commit (diff) | |
| download | nvim-lspconfig-168c4d0c178f040c81111ec168217353dc901214.tar nvim-lspconfig-168c4d0c178f040c81111ec168217353dc901214.tar.gz nvim-lspconfig-168c4d0c178f040c81111ec168217353dc901214.tar.bz2 nvim-lspconfig-168c4d0c178f040c81111ec168217353dc901214.tar.lz nvim-lspconfig-168c4d0c178f040c81111ec168217353dc901214.tar.xz nvim-lspconfig-168c4d0c178f040c81111ec168217353dc901214.tar.zst nvim-lspconfig-168c4d0c178f040c81111ec168217353dc901214.zip | |
[ZLS] change root_dir
Diffstat (limited to 'lua/nvim_lsp')
| -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]]; }; }; }; |
