Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intrusive Diagnostics #1462

Closed
k2d222 opened this issue Jan 8, 2022 · 19 comments · Fixed by #6417
Closed

Intrusive Diagnostics #1462

k2d222 opened this issue Jan 8, 2022 · 19 comments · Fixed by #6417
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@k2d222
Copy link
Contributor

k2d222 commented Jan 8, 2022

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 diagnostics command
  • 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)
Screenshot from 2022-01-08 17-04-06

@k2d222 k2d222 added the C-enhancement Category: Improvements label Jan 8, 2022
@kirawi
Copy link
Member

kirawi commented Jan 9, 2022

Would #1445 fix it for you?

@archseer
Copy link
Member

archseer commented Jan 9, 2022

No it wouldn't, it's orthogonal :P

@archseer
Copy link
Member

archseer commented Jan 9, 2022

There's two features that would be nice:

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Jan 9, 2022
@dariooddenino
Copy link
Contributor

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

@ngraham20
Copy link
Contributor

+1 for the temporary buffer idea

@ngraham20
Copy link
Contributor

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

@aspizu
Copy link

aspizu commented Dec 29, 2022

can you do it like vscode does it with a problems pane

@manan-gup
Copy link

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.

@eliasboegel
Copy link

eliasboegel commented Jan 25, 2023

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.

image
image

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.

@dogunbound
Copy link

+1 for simply drawing over the diagnostics, but only if a cursor is on the same line as the diagnostic.

@cemalokten
Copy link
Contributor

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:

Screenshot 2023-01-31 at 12 25 59

@0rphee
Copy link
Contributor

0rphee commented Feb 22, 2023

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!

@kirawi
Copy link
Member

kirawi commented Feb 22, 2023

#6059

@bugeats
Copy link

bugeats commented Mar 17, 2023

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.

@Teddy-94
Copy link

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...

@gfarrell
Copy link

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.

@0ihsan
Copy link

0ihsan commented Jan 5, 2024

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

@zvxvx
Copy link

zvxvx commented Mar 31, 2024

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.

@kemelzaidan
Copy link

#11096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.