diff --git a/.vim/nvim.lua b/.vim/nvim.lua index e8dd274..2ee4804 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -35,7 +35,24 @@ nvim_lsp.rust_analyzer.setup({ } } }) -nvim_lsp.gopls.setup({ on_attach = on_attach }) +nvim_lsp.gopls.setup({ + on_attach = function (client, bufnr) + client.server_capabilities.semanticTokensProvider = { + full = 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', 'decorator', }, + tokenTypes = { 'namespace' }, + tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary', + }, + } + } + end, + settings = { + gopls = { + semanticTokens = true, + }, + }, +}) nvim_lsp.pyright.setup({ on_attach = on_attach }) nvim_lsp.clangd.setup({ on_attach = on_attach }) diff --git a/.vimrc b/.vimrc index b54aa61..bc496f4 100644 --- a/.vimrc +++ b/.vimrc @@ -1073,6 +1073,13 @@ endfunction map :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" +function! Syn() + for id in synstack(line("."), col(".")) + echo synIDattr(id, "name") + endfor +endfunction +map command! -nargs=0 Syn call Syn() + " Final hi links for TreeSitter hi link @type.rust TSCSecondaryTypeParam