helix
helix copied to clipboard
Intrusive Diagnostics
Diagnostics appear on top of the code.
Diagnostics are always drawn from the top-right corner, with a max witdth of 100 chars and word wrapping.
I'm not sure what the best solution to this problem is, here are a few ideas:
- just draw code over diagnostics (code has higher priority)
- add a
show / hide diagnosticscommand - ellipsize diagnostics and make a popup to show longer version
- wrap diagnostics when conflicting with a line of code
- Show diagnostics in a box after timeout, similar to the snippets / signature help box
(see this c++ code where STL template diagnostics are particularly verbose)

Would https://github.com/helix-editor/helix/pull/1445 fix it for you?
No it wouldn't, it's orthogonal :P
There's two features that would be nice:
- A config option that allows disabling the diagnostics overlay
- Something like https://github.com/emacs-lsp/lsp-ui/blob/21ce926eedd41ef305c2d89412506ce59b1a7eac/lsp-ui-sideline.el#L216-L230 that considers where the last code character on the line is
I have a similar need.
Purescript errors can be VERY long when there's a row type error. They get truncated and right aligned with the current diagnstics, making them almost useless.
Ideally I'd like to be able to:
- display a diagnostic message on a scrollable popup
- open the message on a new temporary buffer so that I can use it as a permanent reference while fixing the code
+1 for the temporary buffer idea
Virtual Text #417 along with Soft Wrap #136 would also do it, as then, the virtual text could just be placed above or below the error line as virtually wrapped lines
can you do it like vscode does it with a problems pane
Having the same issue where the diagnostic message covers the code that I'm trying to edit. Is there any workaround till this is fixed?
P.S. Stopped using VS Code a few months ago and tried a few flavours of NeoVim distros and then Helix. I have to say that I'm loving the Helix experience.
In my opinion, the way neovim and lspsaga.nvim do it is quite nice:
- There is some space and visual markers before showing one diagnostics message inline, a dot or square or similar, one per diagnostic in that line. The color of the markers and text indicates the diagnostic type(s). (Not too different from current behaviour, except for the separation and which line it is displayed in)
- On jumping to a diagnostic, a small pop up opens, showing the diagnostics of this line in full-text separated from each other.

In my opinion, the inline diagnostics are still quite clean, but also noticeable - more importantly, there is a clear separation between code and diagnostic, while not covering up any code. When the full diagnostic text is necessary, (i.e. when jumping through diagnostics), the full text is displayed in a pop up clearly separated from the text.
+1 for simply drawing over the diagnostics, but only if a cursor is on the same line as the diagnostic.
How about displaying error/warning messages in the status bar when the cursor is on top of the issue? It's keeps the errors out of the way but are there for when you need them. I had it setup like this previously while using ALE in Neovim and it worked well. Currently dealing with this sort of thing half way through typing:

is this feature already in the works? as i understand, virtual text is already supported through #5420
anyway, i'm just want to get rid off those awful lsp messages haha!
https://github.com/helix-editor/helix/pull/6059
Until #6059 lands, it seems to me the quick fix is to simply render the diagnostic messages at the bottom of the pane instead of the top. You can always shift up the view center (zz) to get cursor out of the way of something on the bottom, where the inverse is not true.
Until #6059 / #6417 could there be a setting to allow hiding the diagnostics message that is in the top right corner? Maybe I missed it but I couldnt find it in the docs...
Also coming here to say that this makes editing in small windows (or many splits) really difficult. Half the time I can't see the code because the LSP errors hide what I'm editing.
In nvim the errors disappear while you're in insert mode (IME at least, I didn't used to think about it because they were never intrusive in neovim), which is one option, but another is just to change where they are displayed (I cannot find a setting for this in the docs).
This is the main thing marring the (otherwise great) helix experience for me.
workaround: disable diagnostics feature
~/.config/helix/languages.toml
[[language]]
name = "c"
language-servers = [{name = "clangd", except-features=["diagnostics"]}]
see also: https://docs.helix-editor.com/languages.html?highlight=diagnostics#configuring-language-servers-for-a-language
Until #6059 lands, it seems to me the quick fix is to simply render the diagnostic messages at the bottom of the pane instead of the top. You can always shift up the view center (
zz) to get cursor out of the way of something on the bottom, where the inverse is not true.
How are you rendering the diagnostics at the bottom instead of the top? I can't find a reference to changing placement.
https://github.com/helix-editor/helix/discussions/11096