bew / dotfiles

All my dotfiles in one place!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lsp: Diagnostics, wanted display

bew opened this issue Β· comments

With LanguageClient_neovim, the display looks like this:
image
πŸ‘‰ Hard to read!!!!!! πŸ‘ˆ
It hides git-gutter's info when there's more than 1 diagnostic on a line.
In addition, the sign column appear ONLY when there's 1+ diagnostic on the currently visible lines.
=> It's very annoying when scrolling to see the sign column appearing and disappearing..

With jedi-vim (not LSP), the display is more subtle, the sign column is persistent (even if no lines with diagnostic currently visible), and the virtual text is visible ONLY for the current line πŸ‘.

TODO: test with the builtin LSP client of nvim 0.5+ !!


Wanted

In sign column area

Use a single sign for diagnostic: <error-or-warning><hint?>
So:

  • ! -> only 1+ warnings on the line
  • x -> 1+ errors and maybe 1+ warnings on the line
  • x? (or not?) -> 1+ errors and maybe 1+ warnings and 1+ hints on the line
    NOTE(fixme?): I think it's not possible to highlight the 2 chars of a sign differently.. So maybe ONLY show error-or-warning? hints can be left ONLY in virtual text.

In virtual text area

Multiple display format here, with a keybind to cycle between them.

F1: Subtle indicator (by default):
Use a subtle indicator, aligned to the right (?) (after the 100th column?)
Similar to πŸ‘‡ to indicate the various diagnostics on the line:
image
Or with text? (!x!!x -> warn then err then warn then warn then err)
Or by numbers? (2! 3x h -> 2 warns, 3 errs, 1 hint))

F2: First error or warning or hint message on current line only.
F3: First error or warning or hint message on all lines with 1+ diagnostics.

https://git.sr.ht/~whynothugo/lsp_lines.nvim uses virtual lines, this is interesting!
Maybe a single virtual line with a count of errors of the line, ability to cycle (?) or only an info line, kind of like F3 above?

#37 (comment) mentions that https://github.com/petertriho/nvim-scrollbar can now display basic information for the whole file.

We could show where the diagnostics are in the file (roughly).
However when a search is in progress, the indicators for search results would take precedence.

α••( ᐛ )α•—

With upcoming statuscolumn (neovim/neovim#20621) we'll get better control on the 'gutter' 😍