Closed carbolymer closed 3 years ago
Can you provide a minimal, complete vimrc that reproduces this issue? I haven't been able to reproduce the issue myself.
@martskins sure, here you have python example with venv, requirements and minimal vimrc: https://gitlab.com/carbolymer/lc-nvim-broken-highlight
I'm still not able to reproduce. I had to move some stuff around in the vimrc you provided there (I didn't have the /vim82/defaults file, I found one though, that I think must be the one you are referring to in there) and the vimrc was missing the colorscheme plugin, which I also think I managed to find. But adding that and moving the plugins to the top of the file worked fine for me and it looked fine as well:
@martskins you don't have errors and hints on the margin so it looks like language server wasn't even started? I think something is still missing there, I'll try to reproduce it again tomorrow.
I'm not sure how pyls works in terms of diagnostics, but the server is definitely running, I tried calling textDocument/definition
just to make sure and it works.
@martskins ok, I've added Dockerfile
which reproduces the problem. If you don't have podman, you can replace podman
with docker
commands in test.sh
Ok I see what's going on. What you are seeing is the text decoration for diagnostics. LanguageClient-neovim defines a few highlight groups to use in the code that has diagnostics to display. You can change those by overriding the g:LanguageClient_diagnosticsDisplay
config variable. The default value is the following:
{
1: {
"name": "Error",
"texthl": "LanguageClientError",
"signText": "✖",
"signTexthl": "LanguageClientErrorSign",
"virtualTexthl": "Error",
},
2: {
"name": "Warning",
"texthl": "LanguageClientWarning",
"signText": "⚠",
"signTexthl": "LanguageClientWarningSign",
"virtualTexthl": "Todo",
},
3: {
"name": "Information",
"texthl": "LanguageClientInfo",
"signText": "ℹ",
"signTexthl": "LanguageClientInfoSign",
"virtualTexthl": "Todo",
},
4: {
"name": "Hint",
"texthl": "LanguageClientInfo",
"signText": "➤",
"signTexthl": "LanguageClientInfoSign",
"virtualTexthl": "Todo",
},
}
The highlight group that's applied is the texthl
bit in those. Note that the highlight groups are LanguageClientWarning
, LanguageClientError
, etc. Those are defined as such:
if !hlexists('LanguageClientWarning')
hi link LanguageClientWarning SpellCap
endif
if !hlexists('LanguageClientInfo')
hi link LanguageClientInfo LanguageClientWarning
endif
if !hlexists('LanguageClientError')
hi link LanguageClientError SpellBad
endif
So in your case it's probably using LanguageClientWarning
, which is a link to SpellCap
, which surely is set by your colorscheme. So if you want to change how that is displayed you'll need to either re-define the LanguageClientWarning
(and/or LanguageClientError
and LanguageClientInfo
) highlight groups, or re-define SpellCap
and SpellBad
. I would advise for the former.
For more info no this see :help g:LanguageClient_diagnosticsDisplay
.
@martskins Thanks a lot for the explanation! I suspected that it was related with the highlight groups but I couldn't figure out which is the right option from the docs. I guess this is not a bug.
:checkhealth LanguageClient
? Not an editor commandDescribe the bug
Cannot disable document highlighting.
Environment
nvim --version
orvim --version
):git rev-parse --short HEAD
): a42594cbin/languageclient --version
): languageclient 0.1.161function LC_maps() if has_key(g:LanguageClient_serverCommands, &filetype) let g:LanguageClient_loggingFile = '/tmp/LanguageClient.log' let g:LanguageClient_serverStderr = '/tmp/LanguageClient_stderr.log' endif endfunction
if &filetype == 'haskell' let g:LanguageClient_documentHighlightDisplay = {} endif
autocmd FileType * call LC_maps()
haskell-language-server version: 0.8.0.0 (GHC: 8.10.1) (PATH: /usr/bin/haskell-language-server-wrapper) (GIT hash: eb58f13f7b8e4f9bc771af30ff9fd82dc4309ff5)