mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Address code review
This commit is contained in:
1 parent
e6a1ac14bb
commit
38dce09463
2 files changed
+6
-6
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user