File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -22645,16 +22645,12 @@ namespace ts {
22645
22645
return undefined;
22646
22646
22647
22647
case SyntaxKind.StringLiteral:
22648
- // import x = require("./mo/*gotToDefinitionHere*/d")
22649
- if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) {
22650
- return resolveExternalModuleName(node, <LiteralExpression>node);
22651
- }
22652
- // External module name in an import declaration
22653
- if ((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) && (<ImportDeclaration>node.parent).moduleSpecifier === node) {
22654
- return resolveExternalModuleName(node, <LiteralExpression>node);
22655
- }
22656
- if ((isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) ||
22657
- isImportCall(node.parent)) {
22648
+ // 1). import x = require("./mo/*gotToDefinitionHere*/d")
22649
+ // 2). External module name in an import declaration
22650
+ // 3). Dynamic import call or require in javascript
22651
+ if ((isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
22652
+ ((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) && (<ImportDeclaration>node.parent).moduleSpecifier === node) ||
22653
+ ((isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || isImportCall(node.parent))) {
22658
22654
return resolveExternalModuleName(node, <LiteralExpression>node);
22659
22655
}
22660
22656
// falls through
You can’t perform that action at this time.
0 commit comments