File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -3353,10 +3353,10 @@ module ts {
33533353
33543354 // Because name in short-hand property assignment has two different meanings: property name and property value,
33553355 // using go-to-definition at such position should go to the variable declaration of the property value rather than
3356- // go to the declaration of the property name (in this case stay at the same position). However, if go-to-defition
3357- // is performed at the location of property accessing , we would like to go to defition of the property in the short-hand
3358- // assignment. Such case is handled as normal by below code section .
3359- if ( node . parent . kind === SyntaxKind . ShorthandPropertyAssignment && ! ( symbol . flags & SymbolFlags . Transient ) ) {
3356+ // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition
3357+ // is performed at the location of property access , we would like to go to definition of the property in the short-hand
3358+ // assignment. This case and others are handled by the following code .
3359+ if ( node . parent . kind === SyntaxKind . ShorthandPropertyAssignment ) {
33603360 var shorthandSymbol = typeInfoResolver . getShorthandAssignmentValueSymbol ( symbol . valueDeclaration ) ;
33613361 var shorthandDeclarations = shorthandSymbol . getDeclarations ( ) ;
33623362 var shorthandSymbolKind = getSymbolKind ( shorthandSymbol , typeInfoResolver ) ;
Original file line number Diff line number Diff line change 33//// var /*valueDeclaration1*/name = "hello";
44//// var /*valueDeclaration2*/id = 100000;
55//// declare var /*valueDeclaration3*/id;
6- //// var obj = {/*valueDefition1 */name, /*valueDefinition2*/id};
6+ //// var obj = {/*valueDefinition1 */name, /*valueDefinition2*/id};
77//// obj./*valueReference1*/name;
88//// obj./*valueReference2*/id;
99
10- goTo . marker ( "valueDefition1 " ) ;
10+ goTo . marker ( "valueDefinition1 " ) ;
1111goTo . definition ( ) ;
1212verify . caretAtMarker ( "valueDeclaration1" ) ;
1313
You can’t perform that action at this time.
0 commit comments