Merge pull request #28818 from Cow258/master

Move await keyword to inside of function
This commit is contained in:
Sheetal Nandi
2018-12-04 12:36:13 -08:00
committed by GitHub
3 changed files with 4 additions and 2 deletions

View File

@@ -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<ExpectedCompletionEntryObject> = (() => {

View File

@@ -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 {

View File

@@ -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 },