yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
447 stars 43 forks source link

Weird semantic highlight behaviour with golsp #483

Open Tachi107 opened 4 months ago

Tachi107 commented 4 months ago

Hi, after the closing of #126, I've tried using the new semanticHighlight option with the Go language server, gopls, but the result is pretty odd. Every token which gets coloured by gopls turns cyan (using the default theme with termguicolors), which is not very helpful.

Is this an error in my configuration, gopls, or the lsp plugin?

Here's the relevant snippet from my vimrc:

packadd! lsp

final lspServers: list<dict<any>> = []

if executable('gopls')
    lspServers->add({
        filetype: ['go'],
        path: 'gopls',
        syncInit: true,
        initializationOptions: {
            semanticTokens: true
        }
    })
endif

autocmd User LspSetup g:LspOptionsSet({noNewlineInCompletion: true, usePopupInCodeAction: true, semanticHighlight: true})
autocmd User LspSetup g:LspAddServer(lspServers)

Thanks! Example images below.