File tree 2 files changed +13
-19
lines changed
2 files changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -5117,10 +5117,10 @@ namespace ts {
5117
5117
* a reference to a symbol can occur anywhere.
5118
5118
*/
5119
5119
function getSymbolScope ( symbol : Symbol ) : Node {
5120
- // If this is the symbol of a function expression, then named references
5121
- // are limited to its own scope.
5120
+ // If this is the symbol of a named function expression or named class expression,
5121
+ // then named references are limited to its own scope.
5122
5122
let valueDeclaration = symbol . valueDeclaration ;
5123
- if ( valueDeclaration && valueDeclaration . kind === SyntaxKind . FunctionExpression ) {
5123
+ if ( valueDeclaration && ( valueDeclaration . kind === SyntaxKind . FunctionExpression || valueDeclaration . kind === SyntaxKind . ClassExpression ) ) {
5124
5124
return valueDeclaration ;
5125
5125
}
5126
5126
Original file line number Diff line number Diff line change 3
3
////class Foo {
4
4
//// }
5
5
////
6
- ////var x = class /**/Foo {
6
+ //////The class expression Foo
7
+ ////var x = class [|Foo|] {
7
8
//// doIt() {
8
- //// return Foo;
9
+ //// return [| Foo|] ;
9
10
//// }
10
11
////
11
12
//// static doItStatically() {
12
- //// return Foo;
13
+ //// return [| Foo|].y ;
13
14
//// }
14
15
//// }
15
16
////
18
19
//// return Foo
19
20
//// }
20
21
//// }
22
+ ////var z = class Foo {}
21
23
22
-
23
- // TODO (yuit): Fix up this test when class expressions are supported.
24
- // Just uncomment the below, remove the marker, and add the
25
- // appropriate ranges in the test itself.
26
- goTo . marker ( ) ;
27
- verify . renameLocations ( /*findInStrings*/ false , /*findInComments*/ false ) ;
28
-
29
- ////let ranges = test.ranges()
30
- ////for (let range of ranges) {
31
- //// goTo.position(range.start);
32
- ////
33
- //// verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
34
- //// }
24
+ let ranges = test . ranges ( )
25
+ for ( let range of ranges ) {
26
+ goTo . position ( range . start ) ;
27
+ verify . renameLocations ( /*findInStrings*/ false , /*findInComments*/ false ) ;
28
+ }
You can’t perform that action at this time.
0 commit comments