From cdc33f51d2c79a655ed09769b357d1636637f29e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Jan 2016 13:30:54 -0800 Subject: [PATCH] Code review comments --- src/services/services.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index f89ba4e94fa..0096838f314 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -5491,7 +5491,7 @@ namespace ts { } function isImportSpecifierSymbol(symbol: Symbol) { - return (symbol.flags & SymbolFlags.Alias) && forEach(symbol.declarations, declaration => declaration.kind === SyntaxKind.ImportSpecifier); + return (symbol.flags & SymbolFlags.Alias) && !!getDeclarationOfKind(symbol, SyntaxKind.ImportSpecifier); } function getInternedName(symbol: Symbol, location: Node, declarations: Declaration[]): string { @@ -5939,10 +5939,11 @@ namespace ts { result.push(typeChecker.getAliasedSymbol(symbol)); } - // For export specifiers, it can be a local symbol, e.g. + // For export specifiers, the exported name can be refering to a local symbol, e.g.: // import {a} from "mod"; // export {a as somethingElse} - // We want the local target of the export (i.e. the import symbol) and not the final target (i.e. "mod".a) + // We want the *local* declaration of 'a' as declared in the import, + // *not* as declared within "mod" (or farther) if (location.parent.kind === SyntaxKind.ExportSpecifier) { result.push(typeChecker.getExportSpecifierLocalTargetSymbol(location.parent)); }