c0bdd12c4c
* 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
13 lines
340 B
TypeScript
13 lines
340 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
////const f: () => number | string = () => {
|
|
//// await Promise.resolve('foo');
|
|
////}
|
|
|
|
verify.codeFix({
|
|
description: "Add async modifier to containing function",
|
|
newFileContent:
|
|
`const f: () => Promise<number | string> = async () => {
|
|
await Promise.resolve('foo');
|
|
}`,
|
|
});
|