-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: codefix for
for await of
(#50623)
- v5.7.2
- v5.7-rc
- v5.7-beta
- v5.6.3
- v5.6.2
- v5.6-rc
- v5.6-beta
- v5.5.4
- v5.5.3
- v5.5.2
- v5.5-rc
- v5.5-beta
- v5.4.5
- v5.4.4
- v5.4.3
- v5.4.2
- v5.4-rc
- v5.4-beta
- v5.3.3
- v5.3.2
- v5.3-rc
- v5.3-beta
- v5.2.2
- v5.2-rc
- v5.2-beta
- v5.1.6
- v5.1.5
- v5.1.3
- v5.1-rc
- v5.1-beta
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0-rc
- v5.0-beta
- v4.9.5
- v4.9.4
- v4.9.3
- v4.9-rc
1 parent
ecf50e8
commit 42f9143
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/cases/fourslash/codeFixAddMissingAwait_forAwaitOf.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/// <reference path="fourslash.ts" /> | ||
// @lib: es2020 | ||
// @target: es2020 | ||
////async function* g() {} | ||
////async function fn() { | ||
//// for (const { } of g()) { } | ||
////} | ||
|
||
verify.codeFix({ | ||
description: ts.Diagnostics.Add_await.message, | ||
index: 0, | ||
newFileContent: | ||
`async function* g() {} | ||
async function fn() { | ||
for await (const { } of g()) { } | ||
}` | ||
}); |