You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to work this out by reading the documentation/issues/discussions, but I need to finally cry uncle. Ultimately, I want to get the diagnostics, but I don't want them to cause the actual code to jump up and down the way g:lsp_diagnostics_virtual_text_enabled does. It really sounds like g:lsp_diagnostics_echo_cursor does what I want. However, I can't get it to do anything. (LspDocumentDiagnostics is close to what I want, except I don't want to sift through all diagnostics. I only want the ones for the current line.)
I tried creating a minimal .vimrc, removing all other plugins, and opening the minimal test file shown below. I would expect that if I leave my cursor on unused1 or unused2 and wait a half second, the statusline would then display the warning about the variable being unused. However, it just continues to show the filename of the buffer.
Does anyone have an idea of what I'm doing wrong? It seems like I must be missing something "obvious".
.vimrc:
setnocompatible" don't try to be compatible with Vi; required for Vundle" make it obvious that the statusline is working:hiStatusLineNC cterm=underlinehiStatusLine cterm=bold ctermfg=white ctermbg=greysetlaststatus=2"~~~~~~~~~~ LANGUAGE SERVER STUFF ~~~~~~~~~~autocmdUserlsp_setupcalllsp#register_server({ 'name': 'Rust Language Server', 'cmd': {server_info->['rust-analyzer']}, 'allowlist': ['rust'] })
function!s:on_lsp_buffer_enabled() abortletg:lsp_diagnostics_enabled=1letg:lsp_diagnostics_virtual_text_enabled=0setlocalsigncolumn= yes" make it obvious that diagnostics are workingletg:lsp_diagnostics_echo_cursor=1endfunctionautocmdUserlsp_buffer_enabledcalls:on_lsp_buffer_enabled()
"~~~~~~~~~~ VUNDLE STUFF ~~~~~~~~~~filetypeoff" requiredsetrtp+=~/.vim/bundle/Vundle.vimcallvundle#begin()
Plugin'VundleVim/Vundle.vim'Plugin'prabirshrestha/vim-lsp'callvundle#end()" requiredfiletypepluginindenton" required
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been trying to work this out by reading the documentation/issues/discussions, but I need to finally cry uncle. Ultimately, I want to get the diagnostics, but I don't want them to cause the actual code to jump up and down the way
g:lsp_diagnostics_virtual_text_enabled
does. It really sounds likeg:lsp_diagnostics_echo_cursor
does what I want. However, I can't get it to do anything. (LspDocumentDiagnostics
is close to what I want, except I don't want to sift through all diagnostics. I only want the ones for the current line.)I tried creating a minimal
.vimrc
, removing all other plugins, and opening the minimal test file shown below. I would expect that if I leave my cursor onunused1
orunused2
and wait a half second, the statusline would then display the warning about the variable being unused. However, it just continues to show the filename of the buffer.Does anyone have an idea of what I'm doing wrong? It seems like I must be missing something "obvious".
.vimrc:
src/main.rs
screenshot (cursor is on
unused1
):Vim version:
Beta Was this translation helpful? Give feedback.
All reactions