emeryao / async-switch

A VS Code extension for toggle a method/function between async and normal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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) => {
            
        });
    }

About

A VS Code extension for toggle a method/function between async and normal


Languages

Language:TypeScript 100.0%