[neovim] Update golang settings

This commit is contained in:
Daniel Carrillo 2023-10-28 17:49:56 +02:00
parent 6dee13061c
commit d05e572840
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
3 changed files with 18 additions and 1 deletions

View File

@ -55,6 +55,20 @@ M.on_attach = function(client)
client.server_capabilities.hover = false
end
if client.name == "gopls" then
if not client.server_capabilities.semanticTokensProvider then
local semantic = client.config.capabilities.textDocument.semanticTokens
client.server_capabilities.semanticTokensProvider = {
full = true,
legend = {
tokenTypes = semantic.tokenTypes,
tokenModifiers = semantic.tokenModifiers,
},
range = true,
}
end
end
require("illuminate").on_attach(client)
end

View File

@ -3,10 +3,11 @@ return {
gopls = {
experimentalPostfixCompletions = true,
analyses = {
unusedparams = true,
shadow = true,
},
staticcheck = true,
directoryFilters = { "-.git" },
semanticTokens = true,
},
},
}

View File

@ -30,3 +30,5 @@ warningCode = 0
[rule.unused-parameter]
[rule.unreachable-code]
[rule.redefines-builtin-id]
[rule.import-shadowing]
[rule.use-any]