-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Improve processing in FindRefs #73253
Conversation
@@ -58,14 +58,6 @@ public void OnCompleted() | |||
{ | |||
} | |||
|
|||
public void OnFindInDocumentStarted(Document document) |
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.
FAR had a system to notify consumers "i'm startign a doc" and "i'm done with a doc". The original thinking was to use that for progress, to display which file we're looking at.
but:
- we never hooked this up to naything at all.
- this wouldn't be a good experience anyways, since we're extremely parallel. so this was removed entirely.
@@ -107,17 +106,21 @@ public async ValueTask OnDefinitionFoundAsync(SymbolGroup group, CancellationTok | |||
await context.OnDefinitionFoundAsync(definitionItem, cancellationToken).ConfigureAwait(false); | |||
} | |||
|
|||
public async ValueTask OnReferenceFoundAsync(SymbolGroup group, ISymbol definition, ReferenceLocation location, CancellationToken cancellationToken) |
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.
view with whitespcae off.
@@ -44,7 +44,7 @@ public async Task FindBasesAsync(IFindUsagesContext context, Document document, | |||
var (symbol, project) = symbolAndProjectOpt.Value; | |||
|
|||
var solution = project.Solution; | |||
var bases = await FindBaseHelpers.FindBasesAsync(symbol, solution, cancellationToken).ConfigureAwait(false); | |||
var bases = FindBaseHelpers.FindBases(symbol, solution, cancellationToken); |
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.
a lot of FAR and helpers becamse sync. will explain how later in pr.
@@ -73,8 +74,6 @@ public IStreamingProgressTracker ProgressTracker | |||
// any of these. | |||
public ValueTask OnStartedAsync(CancellationToken cancellationToken) => default; | |||
public ValueTask OnCompletedAsync(CancellationToken cancellationToken) => default; | |||
public ValueTask OnFindInDocumentStartedAsync(Document document, CancellationToken cancellationToken) => default; | |||
public ValueTask OnFindInDocumentCompletedAsync(Document document, CancellationToken cancellationToken) => default; |
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.
FAR had a system to notify consumers "i'm startign a doc" and "i'm done with a doc". The original thinking was to use that for progress, to display which file we're looking at.
but:
we never hooked this up to naything at all.
this wouldn't be a good experience anyways, since we're extremely parallel. so this was removed entirely.
@@ -54,22 +54,20 @@ public static partial class SymbolFinder | |||
var sourceMember = await FindSourceDefinitionAsync(m, solution, cancellationToken).ConfigureAwait(false); | |||
var bestMember = sourceMember ?? m; | |||
|
|||
if (await IsOverrideAsync(solution, bestMember, symbol, cancellationToken).ConfigureAwait(false)) | |||
{ | |||
if (IsOverride(solution, bestMember, symbol)) |
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.
src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferenceCache.cs
Outdated
Show resolved
Hide resolved
@@ -114,20 +180,13 @@ public Task FindReferencesAsync(ISymbol symbol, CancellationToken cancellationTo | |||
// which is why we do it in this loop and not inside the concurrent project processing that happens | |||
// below. | |||
await symbolSet.InheritanceCascadeAsync(currentProject, cancellationToken).ConfigureAwait(false); | |||
allSymbols = symbolSet.GetAllSymbols(); | |||
var allSymbols = symbolSet.GetAllSymbols(); | |||
|
|||
// Report any new symbols we've cascaded to to our caller. | |||
await ReportGroupsAsync(allSymbols, cancellationToken).ConfigureAwait(false); |
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.
I assume this can't be moved into the parallel part of the computation?
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.
let me noodle on that. it would be clunkier. Fundamentally, the inheritance cascade is serial. The reporting of results it finds is... not that important. but the reporting does need to happen prior to any symbols for a group being fired.
src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs
Outdated
Show resolved
Hide resolved
.../Portable/FindSymbols/FindReferences/FindReferencesSearchEngine_FindReferencesInDocuments.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs
Show resolved
Hide resolved
@@ -380,7 +376,7 @@ protected static Task FindDocumentsWithForEachStatementsAsync<TData>(Project pro | |||
CancellationToken cancellationToken) | |||
{ | |||
var document = state.Document; |
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.
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.
removed.
src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.UnrootedSymbolSet.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.UnrootedSymbolSet.cs
Outdated
Show resolved
Hide resolved
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.
Similar to what was done in #73249.