diff options
author | hui.liu <[email protected]> | 2021-07-09 00:35:41 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-08 12:35:41 -0400 |
commit | 53fed9d65538e0b9dcad6f32cca63b1d445a76dd (patch) | |
tree | 2c28d47cff9c45f5c5626516118600e4a8e6621b /ftplugin/zig.lua | |
parent | 9233611bdcad1603cd217f6cc8a90e1a7e7a91b8 (diff) |
Check lsp client is active for all language files (#790)
Diffstat (limited to 'ftplugin/zig.lua')
-rw-r--r-- | ftplugin/zig.lua | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/ftplugin/zig.lua b/ftplugin/zig.lua index 92b4120d..55707d85 100644 --- a/ftplugin/zig.lua +++ b/ftplugin/zig.lua @@ -1,11 +1,14 @@ --- Because lspinstall don't support zig yet, --- So we need zls preset in global lib --- Further custom install zls in --- https://github.com/zigtools/zls/wiki/Downloading-and-Building-ZLS -require("lspconfig").zls.setup { - root_dir = require("lspconfig").util.root_pattern(".git", "build.zig", "zls.json"), - on_attach = require("lsp").common_on_attach, -} +if not require("lv-utils").check_lsp_client_active "zls" then + -- Because lspinstall don't support zig yet, + -- So we need zls preset in global lib + -- Further custom install zls in + -- https://github.com/zigtools/zls/wiki/Downloading-and-Building-ZLS + require("lspconfig").zls.setup { + root_dir = require("lspconfig").util.root_pattern(".git", "build.zig", "zls.json"), + on_attach = require("lsp").common_on_attach, + } +end + require("lv-utils").define_augroups { _zig_autoformat = { { "BufEnter", "*.zig", ':lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s")' }, |