vim-lsp
vim-lsp copied to clipboard
Add support for virtual text diagnostics in Vim9
could you also add screenshots?
The »
prefix is from let g:lsp_diagnostics_virtual_text_prefix = '» '
Often errors occured.
~Ah, I see vim-lsp only delays the processing of incoming diagnostics, but then processes all of them, including outdated ones, eidting and the textprop API then complains if a diagnostics refers to a line that no longer exists. I'll have to take a closer look at how things work, and decide whether the processing can be improved in general, or if I'll just have to drop diagnostics that refer to lines that no longer exist.~
Edit: I misunderstood what I was seeing in the logs. There "just" seems to be a race where during editing updated diagnostics come in, but aren't applied just yet due to lsp_diagnostics_virtual_text_delay
, then more editing happens, and then then virtual text is created based on the old diagnostics, because the new changes are still in the didChange
queue.
@prabirshrestha I'm not sure what's the best way to handle that (I'm not familiar with the code base), should I just skip diagnostics that refer to invalid lines and let it sort it itself out with the next batch of diagnostics?
Thanks!
This is async problem, you can skip diagnostics that are in invalid line or column. We probably want is_valid_range()
method that we can user everywhere for future async problems. Having flags such as disabling diagnostics for current line or insert mode can also help.
Any progress on this?
Should be good to go
Check errors seem to be from the Github actions being broken, independently from my changes.
Merged. Thanks. This looks great been using it and loving it!