From 3ff58b07419ae875870b9d2c1bb4436266c18504 Mon Sep 17 00:00:00 2001 From: ray-x Date: Wed, 20 Mar 2024 12:34:29 +1100 Subject: [PATCH] gopls noSemanticString option --- lua/go/gopls.lua | 4 ++-- lua/go/ts/nodes.lua | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lua/go/gopls.lua b/lua/go/gopls.lua index 7145f34..4108d99 100644 --- a/lua/go/gopls.lua +++ b/lua/go/gopls.lua @@ -375,8 +375,8 @@ M.setups = function() diagnosticsTrigger = 'Save', symbolMatcher = 'FastFuzzy', semanticTokens = true, - noSemanticTokens = true, -- disable semantic string tokens so we can use treesitter highlight injection - vulncheck = true, + noSemanticString = true, -- disable semantic string tokens so we can use treesitter highlight injection + vulncheck = 'Imports', ['local'] = get_current_gomod(), gofumpt = _GO_NVIM_CFG.lsp_gofumpt or false, -- true|false, -- turn on for new repos, gofmpt is good but also create code turmoils buildFlags = { '-tags', 'integration' }, diff --git a/lua/go/ts/nodes.lua b/lua/go/ts/nodes.lua index 8d47fd7..0225e3c 100644 --- a/lua/go/ts/nodes.lua +++ b/lua/go/ts/nodes.lua @@ -273,10 +273,12 @@ M.nodes_at_cursor = function(query, default, bufnr, ntype) end ulog(row, col, vim.inspect(nodes_at_cursor):sub(1, 100)) if nodes_at_cursor == nil or #nodes_at_cursor == 0 then - vim.notify( - 'Unable to find any nodes at pos. ' .. tostring(row) .. ':' .. tostring(col), - vim.log.levels.DEBUG - ) + if _GO_NVIM_CFG.verbose then + vim.notify( + 'Unable to find any nodes at pos. ' .. tostring(row) .. ':' .. tostring(col), + vim.log.levels.DEBUG + ) + end ulog('Unable to find any nodes at pos. ' .. tostring(row) .. ':' .. tostring(col)) return nil end