Skip to content

Commit c85460b

Browse files
authored
Merge pull request #28818 from Cow258/master
Move await keyword to inside of function
2 parents 24b39f9 + a2851d2 commit c85460b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/harness/fourslash.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4775,6 +4775,7 @@ namespace FourSlashInterface {
47754775
"package",
47764776
"yield",
47774777
"async",
4778+
"await",
47784779
].map(keywordEntry);
47794780

47804781
// TODO: many of these are inappropriate to always provide
@@ -4907,6 +4908,7 @@ namespace FourSlashInterface {
49074908
"package",
49084909
"yield",
49094910
"async",
4911+
"await",
49104912
].map(keywordEntry);
49114913

49124914
export const globalKeywordsPlusUndefined: ReadonlyArray<ExpectedCompletionEntryObject> = (() => {

src/services/completions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,7 @@ namespace ts.Completions {
19571957
}
19581958

19591959
function isFunctionLikeBodyKeyword(kind: SyntaxKind) {
1960-
return kind === SyntaxKind.AsyncKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
1960+
return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
19611961
}
19621962

19631963
function keywordForNode(node: Node): SyntaxKind {

tests/cases/fourslash/completionInFunctionLikeBody.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
verify.completions(
1717
{
1818
marker: ["1", "2"],
19-
includes: "async",
19+
includes: ["async", "await"],
2020
excludes: ["public", "private", "protected", "constructor", "readonly", "static", "abstract", "get", "set"],
2121
},
2222
{ marker: ["3", "4"], exact: completion.classElementKeywords, isNewIdentifierLocation: true },

0 commit comments

Comments
 (0)