microsoft / microsoft/vs-threading

Refactoring: Make method async and await call-sites

Open
#746 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
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:

  1. 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)
  2. Use 'Add await' codefix to get CS4033
  3. Use 'Make method async' to get VSTHRD110 or CS4014 on call-sites
  4. Repeat

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.