microsoft / microsoft/vs-threading
Refactoring: Make method async and await call-sites
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1k
- Forks
- 160
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 28
Description
Is your feature request related to a problem? Please describe.
Migrating a codebase to use async overloads where available and make the enclosing methods async as well.
Describe the solution you'd like
Whenever an async overload is available in a non-async method, suggest to use that, make method async and update call-sites.
If this is done as a fix-all, this can be recursively applied to the call graph.
Describe alternatives you've considered
Currently this can be done in a few repetitive steps until the whole thing is migrated, but it is extremely cumbersome:
- Change some method call to Async overload to get VSTHRD110, or
Change method return type to Task to get VSTHRD103 (note: 'change signature' doesn't support this) - Use 'Add await' codefix to get CS4033
- Use 'Make method async' to get VSTHRD110 or CS4014 on call-sites
- Repeat
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing VSTHRD103/VSTHRD110 diagnostics and the Add await and Make method async code fixes described in the issue. Map how a changed method signature propagates to call-sites, then define bounded fix-all behavior; done means async overloads, enclosing methods, and call-sites can be migrated consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100