|
|
@ -91,18 +91,53 @@ local on_attach = function(client, bufnr)
|
|
|
|
elseif type(_GO_NVIM_CFG.lsp_keymaps) == 'function' then
|
|
|
|
elseif type(_GO_NVIM_CFG.lsp_keymaps) == 'function' then
|
|
|
|
_GO_NVIM_CFG.lsp_keymaps(bufnr)
|
|
|
|
_GO_NVIM_CFG.lsp_keymaps(bufnr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if
|
|
|
|
if client.name == 'gopls' and vim.fn.has('nvim-0.8.3') == 1 then
|
|
|
|
client.name == 'gopls'
|
|
|
|
|
|
|
|
and vim.fn.has('nvim-0.8.3') == 1
|
|
|
|
|
|
|
|
and not client.server_capabilities.semanticTokensProvider
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
local semantic = client.config.capabilities.textDocument.semanticTokens
|
|
|
|
local semantic = client.config.capabilities.textDocument.semanticTokens
|
|
|
|
|
|
|
|
local provider = client.server_capabilities.semanticTokensProvider
|
|
|
|
if semantic then
|
|
|
|
if semantic then
|
|
|
|
client.server_capabilities.semanticTokensProvider = {
|
|
|
|
client.server_capabilities.semanticTokensProvider =
|
|
|
|
full = true,
|
|
|
|
vim.tbl_deep_extend('force', provider or {}, {
|
|
|
|
legend = { tokenModifiers = semantic.tokenModifiers, tokenTypes = semantic.tokenTypes },
|
|
|
|
full = true,
|
|
|
|
range = true,
|
|
|
|
legend = {
|
|
|
|
}
|
|
|
|
tokenTypes = {
|
|
|
|
|
|
|
|
'namespace',
|
|
|
|
|
|
|
|
'type',
|
|
|
|
|
|
|
|
'class',
|
|
|
|
|
|
|
|
'enum',
|
|
|
|
|
|
|
|
'interface',
|
|
|
|
|
|
|
|
'struct',
|
|
|
|
|
|
|
|
'typeParameter',
|
|
|
|
|
|
|
|
'parameter',
|
|
|
|
|
|
|
|
'variable',
|
|
|
|
|
|
|
|
'property',
|
|
|
|
|
|
|
|
'enumMember',
|
|
|
|
|
|
|
|
'event',
|
|
|
|
|
|
|
|
'function',
|
|
|
|
|
|
|
|
'method',
|
|
|
|
|
|
|
|
'macro',
|
|
|
|
|
|
|
|
'keyword',
|
|
|
|
|
|
|
|
'modifier',
|
|
|
|
|
|
|
|
'comment',
|
|
|
|
|
|
|
|
'string',
|
|
|
|
|
|
|
|
'number',
|
|
|
|
|
|
|
|
'regexp',
|
|
|
|
|
|
|
|
'operator',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
tokenModifiers = {
|
|
|
|
|
|
|
|
'declaration',
|
|
|
|
|
|
|
|
'definition',
|
|
|
|
|
|
|
|
'readonly',
|
|
|
|
|
|
|
|
'static',
|
|
|
|
|
|
|
|
'deprecated',
|
|
|
|
|
|
|
|
'abstract',
|
|
|
|
|
|
|
|
'async',
|
|
|
|
|
|
|
|
'modification',
|
|
|
|
|
|
|
|
'documentation',
|
|
|
|
|
|
|
|
'defaultLibrary',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
range = true,
|
|
|
|
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|