TypeScript/tests/cases/fourslash/codeFixAddMissingAwait_initializer4.ts
Andrew Branch 797c5362a2
Codefix: Don’t return a fixId if there’s definitely nothing else that can be fixed (#35765)
* Start fixing fixId

* Fix tests

* Add comment

* Fix unit tests, remove fixAllDescription when unavailable

* Add codeFixAllAvailable to fourslash harness
2020-01-16 10:07:37 -08:00

20 lines
406 B
TypeScript

/// <reference path="fourslash.ts" />
////async function fn(a: string, b: Promise<string>) {
//// const x = b;
//// const y = b;
//// x + y;
////}
verify.codeFix({
description: "Add 'await' to initializers",
index: 0,
newFileContent:
`async function fn(a: string, b: Promise<string>) {
const x = await b;
const y = await b;
x + y;
}`
});
verify.not.codeFixAllAvailable("addMissingAwait");