Merge pull request #8491 from Microsoft/sourceFile-getSymbolAtLocation

getSymbolAtLocation now returns symbol for external modules
This commit is contained in:
Vladimir Matveev 2016-05-05 18:52:18 -07:00
commit 7c043b67ae

View file

@ -16587,6 +16587,9 @@ namespace ts {
} }
function getSymbolAtLocation(node: Node) { function getSymbolAtLocation(node: Node) {
if (node.kind === SyntaxKind.SourceFile) {
return isExternalModule(<SourceFile>node) ? getMergedSymbol(node.symbol) : undefined;
}
if (isInsideWithStatementBody(node)) { if (isInsideWithStatementBody(node)) {
// We cannot answer semantic questions within a with block, do not proceed any further // We cannot answer semantic questions within a with block, do not proceed any further
return undefined; return undefined;