Handle the require call in javascript file for getSymbolAtLocation

This helps in getting the alias symbol so that it can go to the definition of external module
Fixes #9251
This commit is contained in:
Sheetal Nandi
2016-10-04 16:29:51 -07:00
parent f4dc11427f
commit 18969b024d
2 changed files with 14 additions and 0 deletions
+3
View File
@@ -18436,6 +18436,9 @@ namespace ts {
(<ImportDeclaration>node.parent).moduleSpecifier === node)) {
return resolveExternalModuleName(node, <LiteralExpression>node);
}
if (isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) {
return resolveExternalModuleName(node, <LiteralExpression>node);
}
// Fall through
case SyntaxKind.NumericLiteral: