From f1cd7327b7b9bdf03dc0a06850558c29ea4f12ed Mon Sep 17 00:00:00 2001 From: Laily Date: Wed, 27 Apr 2022 08:09:53 +0800 Subject: [PATCH] fix: gopls --- nvim/lua/lang/go.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvim/lua/lang/go.lua b/nvim/lua/lang/go.lua index 253be68..6f47487 100644 --- a/nvim/lua/lang/go.lua +++ b/nvim/lua/lang/go.lua @@ -1,9 +1,9 @@ -- LSP require'lspconfig'.gopls.setup{ -- cmd = {DATA_PATH .. "/lspinstall/go/gopls"}, - cmd = {"gopls"}, -- use cmd in path, I can update it easily + cmd = {"gopls","serve"}, -- use cmd in path, I can update it easily settings = {gopls = {analyses = {unusedparams = true}, staticcheck = true}}, - root_dir = require'lspconfig'.util.root_pattern(".git","go.mod"), + root_dir = require'lspconfig'.util.root_pattern(".git","go.mod","go.work"), init_options = {usePlaceholders = true, completeUnimported = true}, on_attach = require'lsp'.common_on_attach }