-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lsp_diagnostics_{echo,float}_cursor don't seem to work? #1081
Comments
Can you paste your vim-lsp logs (instructions in readme). If you can repro in some open source project that would be great. You might also want to checkout https://github.com/mattn/vim-lsp-settings for easy setup of lsp servers. |
Sure, here's a simple example (also at https://github.com/dhduvall/vim-lsp-1081): fn main() {
jj jj = 6;
} This is what I have in my terminal:
so the error is definitely detected, but neither hitting
I already use |
The issue is that I see neither. Thanks for confirming that it works for you. I'll spend some time trimming my vim configuration down to see if I can figure out what there is causing it, and report back. |
I had let g:lsp_diagnostics_float_cursor = 1
let g:lsp_diagnostics_echo_cursor = 1 inside a function that got called on I did note in stripping my |
In my case—because I just had absolutely no clue, not the faintest idea where to put the function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
" ⋮
let g:lsp_format_sync_timeout = 1000
autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
endfunction that I copy-pasted from the vim-lsp setup instructions. Although the buffer would have the correct value if you checked with Moving let g:lsp_diagnostics_echo_cursor = 1
let g:lsp_diagnostics_virtual_text_enabled = 0 inside augroup lsp_install
au!
" call s:on_lsp_buffer_enabled only for languages that has the server registered
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
" ⋮
augroup END (also copy-pasted from the vim-lsp setup instructions) finally produced the correct results for me. Edit: There was, in fact a resolved discussion about this, where @prabirshrestha provided the answer. |
This is on vim 8.2.2550 (on MacOS, via brew), with ca2b527 of vim-lsp, and the code in question is Rust, using
rust-analyzer
(thoughrls
had the same issue).When I move the cursor onto a line where there's a diagnostics issue (there's a sign, and it shows up in
:LspDocumentDiagnostics
, if eitherg:lsp_diagnostics_echo_cursor
org:lsp_diagnostics_float_cursor
is set to1
(or both are), I don't get the expected behavior of seeing the diagnostic in the status line or in a popup.The text was updated successfully, but these errors were encountered: