File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1713,6 +1713,9 @@ namespace ts.Completions {
1713
1713
break ;
1714
1714
case SyntaxKind . AsteriskToken :
1715
1715
return isMethodDeclaration ( parent ) ? tryCast ( parent . parent , isObjectLiteralExpression ) : undefined ;
1716
+ case SyntaxKind . Identifier :
1717
+ return ( contextToken as Identifier ) . text === "async" && isShorthandPropertyAssignment ( contextToken . parent )
1718
+ ? contextToken . parent . parent : undefined ;
1716
1719
}
1717
1720
}
1718
1721
@@ -1928,7 +1931,6 @@ namespace ts.Completions {
1928
1931
// Previous token may have been a keyword that was converted to an identifier.
1929
1932
switch ( keywordForNode ( contextToken ) ) {
1930
1933
case SyntaxKind . AbstractKeyword :
1931
- case SyntaxKind . AsyncKeyword :
1932
1934
case SyntaxKind . ClassKeyword :
1933
1935
case SyntaxKind . ConstKeyword :
1934
1936
case SyntaxKind . DeclareKeyword :
@@ -1943,6 +1945,8 @@ namespace ts.Completions {
1943
1945
case SyntaxKind . VarKeyword :
1944
1946
case SyntaxKind . YieldKeyword :
1945
1947
return true ;
1948
+ case SyntaxKind . AsyncKeyword :
1949
+ return isPropertyDeclaration ( contextToken . parent ) ;
1946
1950
}
1947
1951
1948
1952
return isDeclarationName ( contextToken )
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ ////const x: { m(): Promise<void> } = { async /**/ };
4
+
5
+ verify . completions ( { marker : "" , exact : "m" } ) ;
You can’t perform that action at this time.
0 commit comments