Skip to content

Commit a2851d2

Browse files
committed
Move await keyword to inside of function and test
1 parent f2d297f commit a2851d2

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/harness/fourslash.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4908,6 +4908,7 @@ namespace FourSlashInterface {
49084908
"package",
49094909
"yield",
49104910
"async",
4911+
"await",
49114912
].map(keywordEntry);
49124913

49134914
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 || SyntaxKind.AwaitKeyword || !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)