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/go.lua | |
parent | 9233611bdcad1603cd217f6cc8a90e1a7e7a91b8 (diff) |
Check lsp client is active for all language files (#790)
Diffstat (limited to 'ftplugin/go.lua')
-rw-r--r-- | ftplugin/go.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ftplugin/go.lua b/ftplugin/go.lua index 56b9cacc..fbad5a2b 100644 --- a/ftplugin/go.lua +++ b/ftplugin/go.lua @@ -1,10 +1,12 @@ -require("lspconfig").gopls.setup { - cmd = { DATA_PATH .. "/lspinstall/go/gopls" }, - settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true } }, - root_dir = require("lspconfig").util.root_pattern(".git", "go.mod"), - init_options = { usePlaceholders = true, completeUnimported = true }, - on_attach = require("lsp").common_on_attach, -} +if not require("lv-utils").check_lsp_client_active "gopls" then + require("lspconfig").gopls.setup { + cmd = { DATA_PATH .. "/lspinstall/go/gopls" }, + settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true } }, + root_dir = require("lspconfig").util.root_pattern(".git", "go.mod"), + init_options = { usePlaceholders = true, completeUnimported = true }, + on_attach = require("lsp").common_on_attach, + } +end vim.opt_local.tabstop = 4 vim.opt_local.shiftwidth = 4 |