Skip to content

Commit 6ea2278

Browse files
authored
Get symbol at location for class expressions/keywords (microsoft#26636)
* getSymbolAtLocation understands class expressions Previously it did not. * Update baselines
1 parent 5433cd8 commit 6ea2278

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/compiler/checker.ts

+1
Original file line numberDiff line numberDiff line change
@@ -27269,6 +27269,7 @@ namespace ts {
2726927269
case SyntaxKind.DefaultKeyword:
2727027270
case SyntaxKind.FunctionKeyword:
2727127271
case SyntaxKind.EqualsGreaterThanToken:
27272+
case SyntaxKind.ClassKeyword:
2727227273
return getSymbolOfNode(node.parent);
2727327274
case SyntaxKind.ImportType:
2727427275
return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal) : undefined;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////[1].forEach(cla/*1*/ss {});
4+
////[1].forEach(cla/*2*/ss OK{});
5+
6+
verify.quickInfoAt("1", "(local class) (Anonymous class)");
7+
verify.quickInfoAt("2", "(local class) OK");
8+

tests/cases/fourslash/quickInfoInvalidLocations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//// property: string;
99
/////*invalid2*/}
1010
////
11-
////cl/*invalid3*/ass bar imple/*invalid4*/ments IFoo {
11+
////class bar imple/*invalid4*/ments IFoo {
1212
//// constructor( /*invalid5*/ ) {
1313
////
1414
//// }

0 commit comments

Comments
 (0)