Closed garymh closed 3 years ago
Hmm, interesting. That does seem to point to VimLS returning something strange - that line is iterating over the result passed to the callback for getting the current function.
However, I cannot reproduce the error on my end (with NVIM v0.5.0-865-gfb52790d1, built just now)... I assume your lsp-status
version is latest, but could you please try rebuilding Neovim from master
just to rule out a temporary breakage in the LSP functionality?
Also, what is your VimLS version? Mine seems to be 2.0.0.
Ah-ha! I went back to see what the issue was in my config since you couldn't reproduce it- I had the standard setup for the statusbar:
function! LspStatus() abort
if luaeval('#vim.lsp.buf_get_clients() > 0')
return luaeval("require('lsp-status').status()")
endif
return ''
endfunction
loading before the lua stuff. I guess being out of order and being sourced again caused it?
Either way, seems to be fixed for me 😄 Sorry for the confusion!
Ah, that would do it! Thanks for the info, and I'm glad things are working for you now!
I have the same issue with rust-analyze, could you please elaborate on how you solved it? I try putting the LspStatus
function at the end of my configuration, but it didn't help.
Edit: Could this be an error with the server instead of the status line?
@joshuachp: Could you please check to see if https://github.com/nvim-lua/lsp-status.nvim/pull/25 fixes this issue for you? If rust-analyzer
or other servers are potentially returning invalid values for the list of symbols, we should be checking for this before trying to process the current function.
Thank you very much, this fixed the CursorHold problem.
The rust-analyzer main thread still panics, but I'm not sure if it is related to lps-status. I have attached the log for the crash if you want to take a look. It happens after a file is saved and formatted with lsp.
Great, I'll merge that PR. From your trace, it seems as though the rust-analyzer panic does not have to do with lsp-status
, though I'm not completely sure why the server is crashing (for instance, I cannot reproduce that panic on my system).
Probably some problems with being on nvim HEAD and Arch version of rust-analyzer, I'll wait to see if it will fix it self. Thank you for your work.
For what it's worth, I'm on the same versions of both, without this error. If you can figure out a minimal Rust source code example to reproduce the issue, I can try to reproduce on my end again.
For me is crashing even on a cargo init project, but after rebuilding rust-analyzer-git it's now fixed. So it was probably a server problem sorry for the trouble.
Hi - I'm running into a weird error with re-sourcing my vimrc file. My config works great normally, but if I try to do a
source $MYVIMRC
again I'll get the following error with the cursor resting on a word:This is with a recent build of neovim from a day or two ago, on macOS 11.0.1. Here is my lua relevant config (lsp.lua):
(loaded in init.nvim with:
luafile $DOTFILES/home/vim/lua/lsp.lua
Maybe the vim language server is returning something weird? 😕
(also: thank you for the great plugin!)