From c402bbd595d794bc4021310f4956b70c5371703e Mon Sep 17 00:00:00 2001 From: Ogromny Date: Thu, 24 Sep 2020 08:57:05 +0200 Subject: [ZLS] initial commit --- lua/nvim_lsp/zls.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lua/nvim_lsp/zls.lua (limited to 'lua') diff --git a/lua/nvim_lsp/zls.lua b/lua/nvim_lsp/zls.lua new file mode 100644 index 00000000..8e91bc8e --- /dev/null +++ b/lua/nvim_lsp/zls.lua @@ -0,0 +1,20 @@ +local configs = require 'nvim_lsp/configs' +local util = require 'nvim_lsp/util' + +configs.zls = { + default_config = { + cmd = {"zls"}; + filetypes = {"zig", "zir"}; + root_dir = util.root_pattern("zls.json", ".git", "."); + }; + docs = { + description = [[ + https://github.com/zigtools/zls + + `Zig LSP implementation + Zig Language Server`. + ]]; + default_config = { + root_dir = [[util.root_pattern("zls.json", ".git") or cwd]]; + }; + }; +}; -- cgit v1.2.3-70-g09d2 From 168c4d0c178f040c81111ec168217353dc901214 Mon Sep 17 00:00:00 2001 From: Ogromny Date: Thu, 24 Sep 2020 13:05:33 +0200 Subject: [ZLS] change root_dir --- lua/nvim_lsp/zls.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lua') 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]]; }; }; }; -- cgit v1.2.3-70-g09d2