Fix isNewIdentifierLocation after generator (#46491)

This commit is contained in:
Adam Burgess 2021-10-25 17:49:31 +11:00 committed by GitHub
parent 7799113e9a
commit 61f5ceb832
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View file

@ -2258,6 +2258,9 @@ namespace ts.Completions {
case SyntaxKind.AsyncKeyword:
return containingNodeKind === SyntaxKind.MethodDeclaration // const obj = { async c|()
|| containingNodeKind === SyntaxKind.ShorthandPropertyAssignment; // const obj = { async c|
case SyntaxKind.AsteriskToken:
return containingNodeKind === SyntaxKind.MethodDeclaration; // const obj = { * c|
}
if (isClassMemberCompletionKeyword(tokenKind)) {

View file

@ -0,0 +1,28 @@
/// <reference path="fourslash.ts" />
//// const obj = {
//// a() {},
//// * b/*1*/
//// };
//// const obj2 = {
//// * /*2*/
//// };
//// const obj3 = {
//// async * /*3*/
//// };
//// class Foo {
//// * b/*4*/
//// }
//// class Foo2 {
//// * /*5*/
//// }
//// class Bar {
//// static * b/*6*/
//// }
test.markerNames().forEach(marker => {
verify.completions({
marker,
isNewIdentifierLocation: true
});
});