File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22665,16 +22665,12 @@ namespace ts {
2266522665 return undefined;
2266622666
2266722667 case SyntaxKind.StringLiteral:
22668- // import x = require("./mo/*gotToDefinitionHere*/d")
22669- if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) {
22670- return resolveExternalModuleName(node, <LiteralExpression>node);
22671- }
22672- // External module name in an import declaration
22673- if ((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) && (<ImportDeclaration>node.parent).moduleSpecifier === node) {
22674- return resolveExternalModuleName(node, <LiteralExpression>node);
22675- }
22676- if ((isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) ||
22677- isImportCall(node.parent)) {
22668+ // 1). import x = require("./mo/*gotToDefinitionHere*/d")
22669+ // 2). External module name in an import declaration
22670+ // 3). Dynamic import call or require in javascript
22671+ if ((isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
22672+ ((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) && (<ImportDeclaration>node.parent).moduleSpecifier === node) ||
22673+ ((isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || isImportCall(node.parent))) {
2267822674 return resolveExternalModuleName(node, <LiteralExpression>node);
2267922675 }
2268022676 // falls through
You can’t perform that action at this time.
0 commit comments