UPDATE
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
buildFlags = { "-tags=unit,integration" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
-- Override LazyVim's gopls semanticTokens workaround, which crashes on
|
||||
-- Neovim 0.12 because the gopls client's config.capabilities has no
|
||||
-- `textDocument` field (go.lua:60). Guard against the nil.
|
||||
gopls = function(_, _)
|
||||
Snacks.util.lsp.on({ name = "gopls" }, function(_, client)
|
||||
if client.server_capabilities.semanticTokensProvider then
|
||||
return
|
||||
end
|
||||
local caps = client.config.capabilities or {}
|
||||
local semantic = caps.textDocument and caps.textDocument.semanticTokens
|
||||
if not semantic then
|
||||
return
|
||||
end
|
||||
client.server_capabilities.semanticTokensProvider = {
|
||||
full = true,
|
||||
legend = {
|
||||
tokenTypes = semantic.tokenTypes,
|
||||
tokenModifiers = semantic.tokenModifiers,
|
||||
},
|
||||
range = true,
|
||||
}
|
||||
end)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user