From 3d8a472527e4f0809c75df42a28d03731dadab35 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Sun, 7 Feb 2016 20:09:14 +0800 Subject: [PATCH] Updated comment --- src/services/services.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index d291078f7b8..7493e894d1c 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4640,8 +4640,11 @@ namespace ts { if (symbol.flags & SymbolFlags.Alias) { const declaration = symbol.declarations[0]; - // We want go to the original declaration if the aliased symbol was declared in the location's parent node. - // Except for cases when the aliased symbol is originating from a named import. + // Go to the original declaration for cases: + // + // (1) when the aliased symbol was declared in location(parent). + // (2) when the aliased symbol is originating from a named import. + // if (node.kind === SyntaxKind.Identifier && (node.parent === declaration || (declaration.kind === SyntaxKind.ImportSpecifier && declaration.parent && declaration.parent.kind === SyntaxKind.NamedImports))) {