[WIP] Allow two symbols to be found at position in tuple (FAR, Highlighting) #24363
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.
Here's what FAR looks like with the current PR:
Customer scenario
In tuple syntax, such as
(Alice, Bob)
, positioning the cursor onAlice
is both referencing the declaration of a tuple field (sot.Alice
andt.Item1
) and the usage of localAlice
.Bugs this fixes
Fixes #20115
Risk
Performance impact
Is this a regression from a previous update?
No
Root cause analysis
How was the bug found?
Known issue from 15.0 (when tuples shipped in C# 7.0 and VB 15.0) and also reported by customers since.
Note: I noticed that highlighting doesn't recompute when the cursor is placed on a highlight. This used to make sense as placing the cursor on the highlight previously did not affect what would be highlighted (it was symmetrical). I think that is ok to leave as-is.
Note 2: I'm still debating whether tuples equivalence should factor or ignore tuple names. This PR modified the logic of a common component (to identify if two symbols are "equivalent") so that tuples names would be factored. This results in fewer and more selective highlights. If we choose to ignore tuple names, then highlighting the first element of tuple
(Alice: alice, Bob: 3)
would also highlight the first element of tuple(Alice, alice, Carol: 2)
.