-
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
Reduce the number of intermediary IEnumerables we create while buildind indices #14140
Reduce the number of intermediary IEnumerables we create while buildind indices #14140
Conversation
Tagging @dotnet/roslyn-ide @tmeschter |
e8f4523
to
c78dcf7
Compare
@jmarolf want to take a look? |
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.
Extra async
s?
@@ -117,7 +118,7 @@ public static partial class SymbolFinder | |||
/// <summary> | |||
/// Find the declared symbols from either source, referenced projects or metadata assemblies with the specified name. | |||
/// </summary> | |||
public static Task<IEnumerable<ISymbol>> FindDeclarationsAsync( | |||
public static async Task<IEnumerable<ISymbol>> FindDeclarationsAsync( |
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.
This doesn't need to be made async
does it?
} | ||
|
||
return FindDeclarationsAsync(project, SearchQuery.Create(name, ignoreCase), SymbolFilter.All, cancellationToken: cancellationToken); | ||
return await FindDeclarationsAsync( |
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.
Can just return rather than await
ing as before?
} | ||
|
||
return FindDeclarationsAsync(project, SearchQuery.Create(name, ignoreCase), filter, cancellationToken: cancellationToken); | ||
return await FindDeclarationsAsync( |
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.
Can just return rather than await
ing as before?
} | ||
|
||
using (Logger.LogBlock(FunctionId.SymbolFinder_Project_Name_FindSourceDeclarationsAsync, cancellationToken)) | ||
{ | ||
return FindSourceDeclarationsAsyncImpl(project, SearchQuery.Create(name, ignoreCase), filter, cancellationToken); | ||
return await FindSourceDeclarationsAsyncImpl( |
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.
Can just return rather than await
ing as before?
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.
No. The types are not compatible.
@@ -361,7 +389,8 @@ public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project pro | |||
/// <summary> | |||
/// Find the symbols for declarations made in source with the specified name. | |||
/// </summary> | |||
public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, string name, bool ignoreCase, SymbolFilter filter, CancellationToken cancellationToken = default(CancellationToken)) | |||
public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync( |
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.
Doesn't need to be async
? (as before)
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.
It needs to be async as the types are not compatible.
Project project, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default(CancellationToken)) | ||
{ | ||
return FindSourceDeclarationsAsync(project, SearchQuery.CreateCustom(predicate), filter, cancellationToken); | ||
return await FindSourceDeclarationsAsync( |
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.
Can just return rather than await
ing as before?
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.
No. The types are not compatible.
@@ -446,13 +476,15 @@ public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project pro | |||
/// <summary> | |||
/// Find the symbols for declarations made in source with a matching name. | |||
/// </summary> | |||
public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync( | |||
public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync( |
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.
Doesn't need to be async
?
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.
It needs to be async as the types are not compatible.
} | ||
|
||
return FindDeclarationsAsync(project, SearchQuery.Create(name, ignoreCase), SymbolFilter.All, cancellationToken: cancellationToken); | ||
return await FindDeclarationsAsync( |
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.
Can just return rather than await
ing as before?
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.
No. The types are not compatible.
} | ||
|
||
return FindDeclarationsAsync(project, SearchQuery.Create(name, ignoreCase), filter, cancellationToken: cancellationToken); | ||
return await FindDeclarationsAsync( |
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.
Can just return rather than await
ing as before?
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.
No. The types are not compatible.
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.
Which types are not compatible?
} | ||
|
||
/// <summary> | ||
/// Find the declared symbols from either source, referenced projects or metadata assemblies with the specified name. | ||
/// </summary> | ||
public static Task<IEnumerable<ISymbol>> FindDeclarationsAsync( | ||
public static async Task<IEnumerable<ISymbol>> FindDeclarationsAsync( |
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.
Doesn't need to be async
?
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.
It needs to be async as the types are not compatible.
The asyncs are necessary. |
} | ||
|
||
return FindDeclarationsAsync(project, SearchQuery.Create(name, ignoreCase), filter, cancellationToken: cancellationToken); | ||
return await FindDeclarationsAsync( |
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.
Which types are not compatible?
} | ||
|
||
private static async Task AddDeclarationsAsync( | ||
Project project, | ||
SearchQuery query, | ||
SymbolFilter filter, | ||
List<ISymbol> list, | ||
ArrayBuilder<ISymbol> list, |
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.
Rename list
to builder
?
Sorry for the delay. LGTM |
No description provided.