Skip to content

Commit 8eefaf4

Browse files
committed
Move await keyword to inside of function (Recovery & try test)
1 parent 4730214 commit 8eefaf4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/services/completions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,7 @@ namespace ts.Completions {
19211921
case KeywordCompletionFilters.None:
19221922
return false;
19231923
case KeywordCompletionFilters.All:
1924-
return kind === SyntaxKind.AsyncKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === SyntaxKind.DeclareKeyword || kind === SyntaxKind.ModuleKeyword
1924+
return kind === SyntaxKind.AsyncKeyword || SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === SyntaxKind.DeclareKeyword || kind === SyntaxKind.ModuleKeyword
19251925
|| isTypeKeyword(kind) && kind !== SyntaxKind.UndefinedKeyword;
19261926
case KeywordCompletionFilters.ClassElementKeywords:
19271927
return isClassMemberCompletionKeyword(kind);
@@ -1957,7 +1957,7 @@ namespace ts.Completions {
19571957
}
19581958

19591959
function isFunctionLikeBodyKeyword(kind: SyntaxKind) {
1960-
return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
1960+
return kind === SyntaxKind.AsyncKeyword || !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", "await"],
19+
includes: "async",
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)