TypeScript/tests/cases/fourslash/codeFixAwaitInSyncFunction8.ts
Sharon Rolel c0bdd12c4c add fixAwaitInSyncFunction code fix (#21069)
* add fixAwaitInSyncFunction code fix

* Just insert the keyword

* only one codefix

* remove comment

* Change explicit return type T to Promise<T>

* Review changes

* Change codefix message
2018-01-09 17:15:08 -08:00

14 lines
314 B
TypeScript

/// <reference path='fourslash.ts' />
////function f(): number | string {
//// await Promise.resolve(8);
////}
verify.codeFix({
description: "Add async modifier to containing function",
newFileContent:
`async function f(): Promise<number | string> {
await Promise.resolve(8);
}`,
});