mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 10:00:13 -06:00
Merge pull request #28850 from Microsoft/awaitInAllFunctions32
[release-3.2] Completion for await keyword to inside of function
This commit is contained in:
commit
aaff894a9e
@ -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> = (() => {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user