From ae58327c9e894f6663bf43496063c167170b4ac3 Mon Sep 17 00:00:00 2001 From: ray-x Date: Thu, 4 Apr 2024 10:11:31 +1100 Subject: [PATCH] updates gopls setting --- lua/go/gopls.lua | 11 ++++++++++- lua/go/null_ls.lua | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lua/go/gopls.lua b/lua/go/gopls.lua index 4108d99..316a100 100644 --- a/lua/go/gopls.lua +++ b/lua/go/gopls.lua @@ -299,15 +299,24 @@ M.setups = function() preselectSupport = true, insertReplaceSupport = true, labelDetailsSupport = true, - snippetSupport = true, + snippetSupport = vim.snippet and true or false, resolveSupport = { properties = { + 'edit', 'documentation', 'details', 'additionalTextEdits', }, }, }, + completionList = { + itemDefaults = { + 'editRange', + 'insertTextFormat', + 'insertTextMode', + 'data', + }, + }, contextSupport = true, dynamicRegistration = true, }, diff --git a/lua/go/null_ls.lua b/lua/go/null_ls.lua index c547aad..e91e927 100644 --- a/lua/go/null_ls.lua +++ b/lua/go/null_ls.lua @@ -198,10 +198,10 @@ return { '--fix=false', '--out-format=json', } - for _, linter in ipairs(_GO_NVIM_CFG.null_ls.golangci_lint.disable) do + for _, linter in ipairs(_GO_NVIM_CFG.null_ls.golangci_lint.disable or {}) do table.insert(args, '--disable=' .. linter) end - for _, linter in ipairs(_GO_NVIM_CFG.null_ls.golangci_lint.enable) do + for _, linter in ipairs(_GO_NVIM_CFG.null_ls.golangci_lint.enable or {}) do table.insert(args, '--enable=' .. linter) end args = vim.list_extend(args, { '--path-prefix', '$ROOT', '$FILENAME' })