mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(53074): Functions with async keyword don't autocomplete (#53079)
This commit is contained in:
@@ -4500,6 +4500,8 @@ function tryGetObjectLikeCompletionContainer(contextToken: Node | undefined): Ob
|
||||
break;
|
||||
case SyntaxKind.AsteriskToken:
|
||||
return isMethodDeclaration(parent) ? tryCast(parent.parent, isObjectLiteralExpression) : undefined;
|
||||
case SyntaxKind.AsyncKeyword:
|
||||
return tryCast(parent.parent, isObjectLiteralExpression);
|
||||
case SyntaxKind.Identifier:
|
||||
return (contextToken as Identifier).text === "async" && isShorthandPropertyAssignment(contextToken.parent)
|
||||
? contextToken.parent.parent : undefined;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: a.ts
|
||||
////type T = {
|
||||
//// foo: () => Promise<void>;
|
||||
////}
|
||||
////const foo: T = {
|
||||
//// async f/**/
|
||||
////}
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{
|
||||
name: "foo",
|
||||
sortText: completion.SortText.LocationPriority,
|
||||
},
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user