-
Notifications
You must be signed in to change notification settings - Fork 183
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
Show diagnostics popup when hovering over gutter icons #2349
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the expected behavior?
1
"diagnostics_gutter_marker": "circle",
If there are 2 diagnostics,
and
diagnostics_gutter_marker
is set to"circle"
display the diagnostics on gutter hover.
2
"diagnostics_gutter_marker": "",
If there are 2 diagnostics,
and
diagnostics_gutter_marker
is set to""
don't display the diagnostics on gutter hover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case 2 it doesn't show the diagnostics in addition to the code actions, because in general they can be unrelated to each other. But I'm not sure, maybe would be better to also see the diagnostics, what do you think? In that case it should probably only filter for the diagnostics which are overlapping the current caret position or selection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I did it correctly, then the popup in your example 2 should show only the first diagnostic with small "d" now (where the caret is).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct.
I will see the diagnotics where the cursor is if I hover the gutter.
But I am not sure I think that behavior is the best choice,
because I can already hover with the cursor over the diagnostics and see the diagnostic.
So it is kind of redudant.
For me it would be more intuitive
if hovering the gutter should show all diagnostics that just exist on the line. (not based on cursor or selection)
So my expected behavior would be the following:
if
"diagnostics_gutter_marker": ""
If there are 2 diagnostics,
display the 2 diagnostics on gutter hover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case with the diagnostic icons disabled it will show only the diagnostic(s) which is/are sent as part of the code action request (CodeActionContext). So there is a good chance that the code actions are related to the diagnostics at the cursor position, especially because we only show Quick Fix actions here. And the code actions request is sent for a particular
range
, so the actions should also be only applicable for the current cursor position.You could consider the diagnostic from this screenshot to be part of the lightbulb hover, and the other diagnostics on the line or on different lines are not shown because the diagnostics gutter icons are disabled. I think it makes sense.
And I would not say that it is redundant, it's rather just a different way to see the diagnostic message. For example I have the code actions in the regular hover popup disabled, so I will never see them if I hover over the error underline.