Address code review
This commit is contained in:
parent
e6a1ac14bb
commit
38dce09463
|
@ -3353,10 +3353,10 @@ module ts {
|
|||
|
||||
// Because name in short-hand property assignment has two different meanings: property name and property value,
|
||||
// using go-to-definition at such position should go to the variable declaration of the property value rather than
|
||||
// go to the declaration of the property name (in this case stay at the same position). However, if go-to-defition
|
||||
// is performed at the location of property accessing, we would like to go to defition of the property in the short-hand
|
||||
// assignment. Such case is handled as normal by below code section.
|
||||
if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment && !(symbol.flags & SymbolFlags.Transient)) {
|
||||
// go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition
|
||||
// is performed at the location of property access, we would like to go to definition of the property in the short-hand
|
||||
// assignment. This case and others are handled by the following code.
|
||||
if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) {
|
||||
var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
|
||||
var shorthandDeclarations = shorthandSymbol.getDeclarations();
|
||||
var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver);
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
//// var /*valueDeclaration1*/name = "hello";
|
||||
//// var /*valueDeclaration2*/id = 100000;
|
||||
//// declare var /*valueDeclaration3*/id;
|
||||
//// var obj = {/*valueDefition1*/name, /*valueDefinition2*/id};
|
||||
//// var obj = {/*valueDefinition1*/name, /*valueDefinition2*/id};
|
||||
//// obj./*valueReference1*/name;
|
||||
//// obj./*valueReference2*/id;
|
||||
|
||||
goTo.marker("valueDefition1");
|
||||
goTo.marker("valueDefinition1");
|
||||
goTo.definition();
|
||||
verify.caretAtMarker("valueDeclaration1");
|
||||
|
||||
|
|
Loading…
Reference in a new issue