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 @@ -22665,16 +22665,12 @@ namespace ts {
22665
22665
return undefined;
22666
22666
22667
22667
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))) {
22678
22674
return resolveExternalModuleName(node, <LiteralExpression>node);
22679
22675
}
22680
22676
// falls through
You can’t perform that action at this time.
0 commit comments