Skip to content

Commit 61f5ceb

Browse files
authored
Fix isNewIdentifierLocation after generator (microsoft#46491)
1 parent 7799113 commit 61f5ceb

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/services/completions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,9 @@ namespace ts.Completions {
22582258
case SyntaxKind.AsyncKeyword:
22592259
return containingNodeKind === SyntaxKind.MethodDeclaration // const obj = { async c|()
22602260
|| containingNodeKind === SyntaxKind.ShorthandPropertyAssignment; // const obj = { async c|
2261+
2262+
case SyntaxKind.AsteriskToken:
2263+
return containingNodeKind === SyntaxKind.MethodDeclaration; // const obj = { * c|
22612264
}
22622265

22632266
if (isClassMemberCompletionKeyword(tokenKind)) {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
//// const obj = {
4+
//// a() {},
5+
//// * b/*1*/
6+
//// };
7+
//// const obj2 = {
8+
//// * /*2*/
9+
//// };
10+
//// const obj3 = {
11+
//// async * /*3*/
12+
//// };
13+
//// class Foo {
14+
//// * b/*4*/
15+
//// }
16+
//// class Foo2 {
17+
//// * /*5*/
18+
//// }
19+
//// class Bar {
20+
//// static * b/*6*/
21+
//// }
22+
23+
test.markerNames().forEach(marker => {
24+
verify.completions({
25+
marker,
26+
isNewIdentifierLocation: true
27+
});
28+
});

0 commit comments

Comments
 (0)