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

Prioritize original user symbol in FAR results above cascaded symbols. #74805

Merged
merged 3 commits into from
Aug 19, 2024

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Aug 19, 2024

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2201415

Ensure that the initial symbol a user performs 'find all references' on is prioritized at the top of the FAR window (above all cascaded symbols):

image

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 19, 2024
@CyrusNajmabadi CyrusNajmabadi changed the title WIP: Prioritize FAR results. Prioritize original user symbol in FAR results above cascaded symbols. Aug 19, 2024
protected readonly List<Entry> EntriesWhenNotGroupingByDefinition = [];
protected readonly List<Entry> EntriesWhenGroupingByDefinition = [];
protected readonly (List<Entry> primary, List<Entry> nonPrimary) EntriesWhenNotGroupingByDefinition = ([], []);
protected readonly (List<Entry> primary, List<Entry> nonPrimary) EntriesWhenGroupingByDefinition = ([], []);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general idea is that we have 'entries' sorted into two sections. The 'primary' entries (those associated with the original symbol teh user is finding) and non-primary (those that came about from cascading).

@@ -134,6 +134,9 @@ private StreamingFindUsagesPresenter(
public IClassificationFormatMap ClassificationFormatMap
=> _lazyClassificationFormatMap.Value;

private static bool IsPrimary(DefinitionItem definition)
=> definition.Properties.ContainsKey(DefinitionItem.Primary);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already had this data in the definitionItem. We were using it for other featuers. but hadn't updated FAR properly.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review August 19, 2024 16:46
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner August 19, 2024 16:46
@CyrusNajmabadi CyrusNajmabadi merged commit 0ec44d9 into dotnet:main Aug 19, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Aug 19, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the farResults branch August 19, 2024 19:08
@dibarbet dibarbet modified the milestones: Next, 17.12 P2 Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants