Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Async SwitchNew to Visual Studio Code? Get it now.
Async Switch

Async Switch

Emeryao

|
7,903 installs
| (1) | Free
An easy way to switch a method/function async or not
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Async Switch

An easy way to switch a method/function async or not async/normal

Command

  • Toggle Async

    • select the method/function line you wanna toggle in a *.ts or *.js file
    • press F1 and select the command
    • or use the shortcut key ctrl+t ctrl+a which means Toggle Async

    demo

Snippets

  • afun

    snippets for a new async function

    async function foo(): Promise<void> {
        return new Promise<void>((resolve, reject) => {
    
        });
    }
    
  • amethod

    snippets for a new async method

    public async foo(): Promise<void> {
        return new Promise<void>((resolve, reject) => {
    
        });
    }
    
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft