Skip to content

Comments

Update methods to be async.#81737

Merged
CyrusNajmabadi merged 46 commits intodotnet:mainfrom
CyrusNajmabadi:runNewAsync
Dec 19, 2025
Merged

Update methods to be async.#81737
CyrusNajmabadi merged 46 commits intodotnet:mainfrom
CyrusNajmabadi:runNewAsync

Conversation

@CyrusNajmabadi
Copy link
Contributor

@CyrusNajmabadi CyrusNajmabadi commented Dec 17, 2025

Wrote a tool for this. General rule was: Method is eligible to become async if it is manually doing Task/ValueTask construction in it somewhere.

So a non-async Task based method that just returns another Task-based method isn't affected. It's only if you're doing things like Task.FromResult(...), new ValueTask(...) etc.

Build: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=12986332&view=results
PR: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/696513

@CyrusNajmabadi CyrusNajmabadi force-pushed the runNewAsync branch 3 times, most recently from 574251e to 04bad0f Compare December 17, 2025 21:20
@@ -102,10 +102,8 @@ public async Task OpenProjectsAsync(ImmutableArray<string> projectFilePaths)
};
}

protected override ValueTask OnProjectUnloadedAsync(string projectFilePath)
protected override async ValueTask OnProjectUnloadedAsync(string projectFilePath)
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
{
{
// Nothing else to unload for ordinary projects.

@CyrusNajmabadi
Copy link
Contributor Author

No regressions found. Marking ready.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review December 19, 2025 15:17
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner December 19, 2025 15:17
@CyrusNajmabadi
Copy link
Contributor Author

@davidwengier @JoeRobich ptal :)

@JoeRobich
Copy link
Member

Boy, I hope we had a refactoring to assist you with all that. =)

@CyrusNajmabadi
Copy link
Contributor Author

Boy, I hope we had a refactoring to assist you with all that. =)

Yup! Standard approach of using Roslyn to modify Roslyn :)

@CyrusNajmabadi CyrusNajmabadi merged commit 6a135ea into dotnet:main Dec 19, 2025
26 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the runNewAsync branch December 19, 2025 19:05
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 19, 2025
davidwengier added a commit that referenced this pull request Dec 30, 2025
Reverts #81737

Above PR introduced multiple speedometer insertions. Getting this ready
in case reverting is the solution.
@davidwengier davidwengier modified the milestones: Next, 18.3 Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants