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

Reorder error/warning message and hover information when hovering with mouse in VSC #6070

Closed
diliop opened this issue Sep 24, 2020 · 13 comments
Labels
A-vscode vscode plugin issues C-support Category: support questions E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@diliop
Copy link

diliop commented Sep 24, 2020

Currently when hovering over parts of the code that have problems (errors, warnings etc.) associated with them, one needs to scroll down past the hover information to get to the error. Most of the times, the rendered hover information is longer than the maximum lines visible in one page of the hover pane forcing the error or warning message to not be visible without scrolling. This is a tad inconvenient and I find myself mostly using peek or the Problems view to see what the error messages are versus hovering with the mouse cursor and getting to see errors that way.

As an example, when hovering over the following error under the .format method, this is what comes up first:
Screen Shot 2020-09-23 at 5 52 06 PM
instead of the error which is placed in the last of the scrollable pages of the hover pane:
Screen Shot 2020-09-23 at 5 52 23 PM

I have looked through the documentation and configuration parameters for rust-analyzer in VSC and I don't see a place where I can configure this behavior by making the error or warning come up first in the hover pane.

@bnjjj
Copy link
Contributor

bnjjj commented Sep 28, 2020

I have the same issue, everytime I need to scroll down to see the error. I will check to change this behavior when we have an error or warning, put this message first. Any concerns about this @matklad ?

@matklad
Copy link
Member

matklad commented Sep 28, 2020

Seems reasonable to me!

@bnjjj
Copy link
Contributor

bnjjj commented Sep 29, 2020

Hmm after investing the issue it seems we have here the display of hover which is the function documentation and the signature and the display of diagnostics coming from textDocument/codeAction. I didn't find the way to change the display order between hover and textDocument/codeAction so vscode didn't let us configure this order. Maybe I'm wrong but I didn't find any information about this topic.

@matklad matklad added E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Oct 14, 2020
@obsgolem
Copy link
Contributor

obsgolem commented Jan 4, 2021

Is there an upstream issue on VSCode to allow this to be fixed? Can this be worked around temporarily by hiding docs whenever an error would also be displayed?

@regexident
Copy link
Contributor

regexident commented Feb 2, 2021

@obsgolem this one probably: Sort Hover Event (#71848)

Possible fix as per this comment by jrieken:

Providers get sorted by their score and in case of equal scores by registration time, later is better.

@obsgolem
Copy link
Contributor

Looking into this I don't think that would work. The score algorithm is based on the strength of the file's match. Rust-Analyzer should get 10, the max, on every .rs file

@edwin0cheng
Copy link
Member

edwin0cheng commented Mar 26, 2021

Upstream issue: microsoft/vscode#73120

@jonas-schievink
Copy link
Contributor

Diagnostics are now showing up on top for me, did we deliberately fix this?

@Veykril
Copy link
Member

Veykril commented Aug 29, 2021

I don't think we did

@Veykril Veykril added the A-vscode vscode plugin issues label Dec 14, 2021
@Veykril
Copy link
Member

Veykril commented Jan 7, 2022

As a headsup, this has been un-fixed again somehow, diagnostics are now appearing below docs again...

@mvtec-bergdolll
Copy link

@Veykril Microsoft or in particular @sandy081 don't seem to prioritize this issue. Would it be possible to detect that a hover has both general information like documentation and an error. And to tell VS Code that it doesn't have any documentation, so that it surfaces the issue directly?

@Veykril
Copy link
Member

Veykril commented Sep 8, 2022

That is a hack I don't see us wanting to have. Sometimes you do want the docs on code with erroneous lines if you are in the middle of writing something which would be a massive annoyance as well. I'd rather Microsoft would just finally fix these importing UX bugs (but you are right, I don't see them going to do that in the near future either ...).

There seems to be a possible fix up microsoft/vscode#166560

@Veykril Veykril added the C-support Category: support questions label Feb 9, 2023
@Veykril
Copy link
Member

Veykril commented Feb 27, 2023

VSCode just merged microsoft/vscode#166560 so this should be fixed in an upcoming release

@Veykril Veykril closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vscode vscode plugin issues C-support Category: support questions E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

9 participants