Dedupe navigate-to results across project flavors#50128
Conversation
| public readonly Document Document; | ||
| public readonly DeclaredSymbolInfo DeclaredSymbolInfo; | ||
|
|
||
| private readonly Lazy<string> _lazyAdditionalInfo; |
There was a problem hiding this comment.
there's no point in being lazy here. we create these values and then immediately marshall them over the OOP boundary, realizing al lthe state of them.
| public string? Summary => null; | ||
|
|
||
| public readonly Document Document; | ||
| public readonly DeclaredSymbolInfo DeclaredSymbolInfo; |
There was a problem hiding this comment.
remove these as there's no point being lazy here.
| // leading to a better condensed view that doesn't look like it contains duplicate info. | ||
| lock (seenItems) | ||
| { | ||
| if (!seenItems.Add(result)) |
There was a problem hiding this comment.
Does this mean results from documents linked into multiple multi-targeting projects will only be shown in a single multi-targeting project? (e.g. PooledHashSet in Roslyn)
There was a problem hiding this comment.
yes. that's what it means :)
|
@CyrusNajmabadi I wonder if you are aware that this is not working for "Go To Implementation" command? |
|
@DavidKarlas Yup. Navigate-to and go-to-impl are different features and need to be updated independently. |
Before:
After:
Note the duplicate results across netcoreapp3.1 and netcoreapp2.0 are gone and you now just get one result for all those flavors. There are still multiple results due to partial files, and we need to make that better, but that's out of scope here.
--
We accomplish this by deduping results that map back to the same file path and same location in that file. There's no point showing multiple results of that sort as all those results will just end navigating back to the exact same file and location.
A more ideal approach might be some mechanism to show that there are multiple results across all the linked projects for a file. However, that's not really supported in the streaming model that navigate-to currently presents us.