From 33c3597b42829a6e7456f14f58f88c68cc2c5801 Mon Sep 17 00:00:00 2001 From: "dreamran43@gmail.com" Date: Tue, 4 Dec 2018 03:01:56 +0800 Subject: [PATCH] Move await keyword to inside of function and test --- src/harness/fourslash.ts | 1 + src/services/completions.ts | 2 +- tests/cases/fourslash/completionInFunctionLikeBody.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 29fc1b5765b..b79a154c555 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -4908,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 93bea69f165..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 || SyntaxKind.AwaitKeyword || !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 },