Skip to content

Commit a9ae9ee

Browse files
authored
fix(53074): Functions with async keyword don't autocomplete (#53079)
1 parent a34d5ae commit a9ae9ee

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/services/completions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4500,6 +4500,8 @@ function tryGetObjectLikeCompletionContainer(contextToken: Node | undefined): Ob
45004500
break;
45014501
case SyntaxKind.AsteriskToken:
45024502
return isMethodDeclaration(parent) ? tryCast(parent.parent, isObjectLiteralExpression) : undefined;
4503+
case SyntaxKind.AsyncKeyword:
4504+
return tryCast(parent.parent, isObjectLiteralExpression);
45034505
case SyntaxKind.Identifier:
45044506
return (contextToken as Identifier).text === "async" && isShorthandPropertyAssignment(contextToken.parent)
45054507
? contextToken.parent.parent : undefined;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: a.ts
4+
////type T = {
5+
//// foo: () => Promise<void>;
6+
////}
7+
////const foo: T = {
8+
//// async f/**/
9+
////}
10+
11+
verify.completions({
12+
marker: "",
13+
includes: [
14+
{
15+
name: "foo",
16+
sortText: completion.SortText.LocationPriority,
17+
},
18+
],
19+
});

0 commit comments

Comments
 (0)