You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The user is always shown quick fixes for all issues on the current line, rather than just for the "current" issue (i.e. the issue under the caret/the issue the mouse is hovering over).
This is confusing, particularly if there are multiple fixes with the same description as the user cannot tell which one will be applied.
Repro
open a file which in which a single line has multiple SonarLint issues with quick fixes on it.
put the caret in one of the issues on the line and wait for the list of suggested actions to appear
clicks on the in-line light-bulb / click on "show potential fixes"
Expected result
The resulting menu only shows fixes for the specific issue under the caret.
Actual result
The initial popup shows only the current issues:
However, the quick fixes menus shows fixes for all issues on the line:
Affected versions
SLVS v5.5+
Notes on the Roslyn implementation
The behaviour of the C# analysers is different: only fixes for the "current" issue are shown:
Quick fixes are calculated indeed with the span that VS gives (whole line)
They are calculating all the diagnostics within the span
All the sets are then ordered in correspondence to the selection span
The ordering uses a comparer that sorts the sets based on proximity -- if I understand this correctly, it will put the sets that are closest to the given selection span... ?
If there is no selection, then it puts the sets in whichever order
All the sets are then filtered by "title", which is each fix's message, picking distinct titles
So basically they're ordering and doing .First()
What I (especially) don't understand is: why they are grouping based on diagnostic span? and not rule id for example? (edited)
The text was updated successfully, but these errors were encountered:
Description
The user is always shown quick fixes for all issues on the current line, rather than just for the "current" issue (i.e. the issue under the caret/the issue the mouse is hovering over).
This is confusing, particularly if there are multiple fixes with the same description as the user cannot tell which one will be applied.
Repro
Expected result
The resulting menu only shows fixes for the specific issue under the caret.
Actual result
The initial popup shows only the current issues:
However, the quick fixes menus shows fixes for all issues on the line:
Affected versions
SLVS v5.5+
Notes on the Roslyn implementation
The behaviour of the C# analysers is different: only fixes for the "current" issue are shown:
What I (especially) don't understand is: why they are grouping based on diagnostic span? and not rule id for example? (edited)
The text was updated successfully, but these errors were encountered: