diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 34fedccc19c..b79a154c555 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -4775,6 +4775,7 @@ namespace FourSlashInterface { "package", "yield", "async", + "await", ].map(keywordEntry); // TODO: many of these are inappropriate to always provide @@ -4907,6 +4908,7 @@ namespace FourSlashInterface { "package", "yield", "async", + "await", ].map(keywordEntry); export const globalKeywordsPlusUndefined: ReadonlyArray = (() => { diff --git a/src/services/completions.ts b/src/services/completions.ts index c127f0c3a7b..43f00c58acf 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1957,7 +1957,7 @@ namespace ts.Completions { } function isFunctionLikeBodyKeyword(kind: SyntaxKind) { - return kind === SyntaxKind.AsyncKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); + return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node: Node): SyntaxKind { diff --git a/tests/cases/fourslash/completionInFunctionLikeBody.ts b/tests/cases/fourslash/completionInFunctionLikeBody.ts index 95407b8f018..8c163ccb3b0 100644 --- a/tests/cases/fourslash/completionInFunctionLikeBody.ts +++ b/tests/cases/fourslash/completionInFunctionLikeBody.ts @@ -16,7 +16,7 @@ verify.completions( { marker: ["1", "2"], - includes: "async", + includes: ["async", "await"], excludes: ["public", "private", "protected", "constructor", "readonly", "static", "abstract", "get", "set"], }, { marker: ["3", "4"], exact: completion.classElementKeywords, isNewIdentifierLocation: true },