Get symbol at location for class expressions/keywords (#26636)
* getSymbolAtLocation understands class expressions Previously it did not. * Update baselines
This commit is contained in:
parent
5433cd8685
commit
6ea2278c7a
3 changed files with 10 additions and 1 deletions
|
@ -27269,6 +27269,7 @@ namespace ts {
|
|||
case SyntaxKind.DefaultKeyword:
|
||||
case SyntaxKind.FunctionKeyword:
|
||||
case SyntaxKind.EqualsGreaterThanToken:
|
||||
case SyntaxKind.ClassKeyword:
|
||||
return getSymbolOfNode(node.parent);
|
||||
case SyntaxKind.ImportType:
|
||||
return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal) : undefined;
|
||||
|
|
8
tests/cases/fourslash/quickInfoClassKeyword.ts
Normal file
8
tests/cases/fourslash/quickInfoClassKeyword.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////[1].forEach(cla/*1*/ss {});
|
||||
////[1].forEach(cla/*2*/ss OK{});
|
||||
|
||||
verify.quickInfoAt("1", "(local class) (Anonymous class)");
|
||||
verify.quickInfoAt("2", "(local class) OK");
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
//// property: string;
|
||||
/////*invalid2*/}
|
||||
////
|
||||
////cl/*invalid3*/ass bar imple/*invalid4*/ments IFoo {
|
||||
////class bar imple/*invalid4*/ments IFoo {
|
||||
//// constructor( /*invalid5*/ ) {
|
||||
////
|
||||
//// }
|
||||
|
|
Loading…
Reference in a new issue