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

Make codepaths sync that don't need to be async #76490

Merged
merged 21 commits into from
Dec 18, 2024

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner December 18, 2024 16:01
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 18, 2024
@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski @JoeRobich ptal.

@@ -92,17 +92,17 @@ private async Task<bool> TryInitializeAsync(
{
if (_service.IsConstructorInitializerGeneration(_document, node, cancellationToken))
{
if (!await TryInitializeConstructorInitializerGenerationAsync(node, cancellationToken).ConfigureAwait(false))
if (!TryInitializeConstructorInitializerGeneration(node, cancellationToken))
Copy link
Member Author

Choose a reason for hiding this comment

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

The core api these were all calling into is SymbolFinder.FindSourceDefinitionAsync. This method is just a wrapper around the synchronous SymbolFinder.FindSourceDefinition method (but part of the public api, so we can't remove it). Updating all internal callers to call the synchronous version caused a lot of code to become synchronous.


/// <inheritdoc cref="FindSourceDefinitionAsync"/>
internal static ISymbol? FindSourceDefinition(
Copy link
Member Author

Choose a reason for hiding this comment

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

moved to shared location so it can be accessed by code-style layer as well.

@@ -241,8 +241,7 @@ public override SyntaxToken VisitToken(SyntaxToken token)

if (tokenNeedsConflictCheck)
{
newToken = RenameAndAnnotateAsync(token, newToken, isRenameLocation, isOldText).WaitAndGetResult_CanCallOnBackground(_cancellationToken);
Copy link
Member Author

Choose a reason for hiding this comment

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

removing this WaitAndGetResult_CanCallOnBackground was the original goal here.

_solution,
symbols,
_cancellationToken)
.WaitAndGetResult_CanCallOnBackground(_cancellationToken);
Copy link
Member Author

Choose a reason for hiding this comment

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

this oen as well.

@CyrusNajmabadi CyrusNajmabadi merged commit 1cdbc3a into dotnet:main Dec 18, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 18, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the syncWork branch December 18, 2024 20:08
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.

2 participants