Skip to content

Commit acc4737

Browse files
authored
Merge pull request #16490 from Microsoft/release_portLSDynamicImport
[Release-2.4] Port basic language service support to release branch
2 parents 1b20d01 + f3e3158 commit acc4737

33 files changed

+111
-9
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22645,14 +22645,12 @@ namespace ts {
2264522645
return undefined;
2264622646

2264722647
case SyntaxKind.StringLiteral:
22648-
// External module name in an import declaration
22649-
if ((isExternalModuleImportEqualsDeclaration(node.parent.parent) &&
22650-
getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
22651-
((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) &&
22652-
(<ImportDeclaration>node.parent).moduleSpecifier === node)) {
22653-
return resolveExternalModuleName(node, <LiteralExpression>node);
22654-
}
22655-
if (isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) {
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))) {
2265622654
return resolveExternalModuleName(node, <LiteralExpression>node);
2265722655
}
2265822656
// falls through

src/services/findAllReferences.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ namespace ts.FindAllReferences.Core {
307307
case SyntaxKind.ExportDeclaration:
308308
return true;
309309
case SyntaxKind.CallExpression:
310-
return isRequireCall(node.parent as CallExpression, /*checkArgumentIsStringLiteral*/ false);
310+
return isRequireCall(node.parent as CallExpression, /*checkArgumentIsStringLiteral*/ false) || isImportCall(node.parent as CallExpression);
311311
default:
312312
return false;
313313
}

tests/baselines/reference/importCallExpression1ESNext.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpression2ESNext.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ function foo(x: Promise<any>) {
3030

3131
foo(import("./0"));
3232
>foo : Symbol(foo, Decl(2.ts, 0, 0))
33+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
3334

tests/baselines/reference/importCallExpression3ESNext.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ async function foo() {
1313
class C extends (await import("./0")).B {}
1414
>C : Symbol(C, Decl(2.ts, 0, 22))
1515
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
16+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
1617
>B : Symbol(B, Decl(0.ts, 0, 0))
1718

1819
var c = new C();

tests/baselines/reference/importCallExpression4ESNext.symbols

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class C {
2222

2323
private myModule = import("./0");
2424
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
25+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2526

2627
method() {
2728
>method : Symbol(C.method, Decl(2.ts, 2, 37))
@@ -49,6 +50,7 @@ class C {
4950

5051
let one = await import("./1");
5152
>one : Symbol(one, Decl(2.ts, 8, 15))
53+
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
5254

5355
console.log(one.backup());
5456
>console : Symbol(console, Decl(2.ts, 0, 11))

tests/baselines/reference/importCallExpressionDeclarationEmit3.symbols

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as Zero from "./0";
1010
>Zero : Symbol(Zero, Decl(1.ts, 1, 6))
1111

1212
import("./0");
13+
>"./0" : Symbol(Zero, Decl(0.ts, 0, 0))
1314

1415
export var p0: Promise<typeof Zero> = import(getPath());
1516
>p0 : Symbol(p0, Decl(1.ts, 4, 10))
@@ -21,8 +22,10 @@ export var p1: Promise<typeof Zero> = import("./0");
2122
>p1 : Symbol(p1, Decl(1.ts, 5, 10))
2223
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --))
2324
>Zero : Symbol(Zero, Decl(1.ts, 1, 6))
25+
>"./0" : Symbol(Zero, Decl(0.ts, 0, 0))
2426

2527
export var p2: Promise<any> = import("./0");
2628
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
2729
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --))
30+
>"./0" : Symbol(Zero, Decl(0.ts, 0, 0))
2831

tests/baselines/reference/importCallExpressionES5AMD.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpressionES5CJS.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpressionES5System.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpressionES5UMD.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpressionInAMD1.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpressionInAMD2.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ function foo(x: Promise<any>) {
3131

3232
foo(import("./0"));
3333
>foo : Symbol(foo, Decl(2.ts, 0, 0))
34+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
3435

tests/baselines/reference/importCallExpressionInAMD3.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ async function foo() {
1313
class C extends (await import("./0")).B {}
1414
>C : Symbol(C, Decl(2.ts, 0, 22))
1515
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
16+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
1617
>B : Symbol(B, Decl(0.ts, 0, 0))
1718

1819
var c = new C();

tests/baselines/reference/importCallExpressionInAMD4.symbols

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class C {
2222

2323
private myModule = import("./0");
2424
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
25+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2526

2627
method() {
2728
>method : Symbol(C.method, Decl(2.ts, 2, 37))
@@ -49,6 +50,7 @@ class C {
4950

5051
let one = await import("./1");
5152
>one : Symbol(one, Decl(2.ts, 8, 15))
53+
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
5254

5355
console.log(one.backup());
5456
>console : Symbol(console, Decl(2.ts, 0, 11))

tests/baselines/reference/importCallExpressionInCJS1.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpressionInCJS2.symbols

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ async function compute(promise: Promise<any>) {
2121

2222
j = await import("./1");
2323
>j : Symbol(j, Decl(2.ts, 1, 7))
24+
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
2425

2526
return j.backup();
2627
>j : Symbol(j, Decl(2.ts, 1, 7))
@@ -31,4 +32,5 @@ async function compute(promise: Promise<any>) {
3132

3233
compute(import("./0"));
3334
>compute : Symbol(compute, Decl(2.ts, 0, 0))
35+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
3436

tests/baselines/reference/importCallExpressionInCJS3.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ function foo(x: Promise<any>) {
3131

3232
foo(import("./0"));
3333
>foo : Symbol(foo, Decl(2.ts, 0, 0))
34+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
3435

tests/baselines/reference/importCallExpressionInCJS4.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ async function foo() {
1313
class C extends (await import("./0")).B {}
1414
>C : Symbol(C, Decl(2.ts, 0, 22))
1515
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
16+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
1617
>B : Symbol(B, Decl(0.ts, 0, 0))
1718

1819
var c = new C();

tests/baselines/reference/importCallExpressionInCJS5.symbols

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class C {
2222

2323
private myModule = import("./0");
2424
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
25+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2526

2627
method() {
2728
>method : Symbol(C.method, Decl(2.ts, 2, 37))
@@ -49,6 +50,7 @@ class C {
4950

5051
let one = await import("./1");
5152
>one : Symbol(one, Decl(2.ts, 8, 15))
53+
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
5254

5355
console.log(one.backup());
5456
>console : Symbol(console, Decl(2.ts, 0, 11))

tests/baselines/reference/importCallExpressionInScriptContext1.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export function foo() { return "foo"; }
55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
var p1 = import("./0");
77
>p1 : Symbol(p1, Decl(1.ts, 0, 3))
8+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
89

910
function arguments() { } // this is allow as the file doesn't have implicit "use strict"
1011
>arguments : Symbol(arguments, Decl(1.ts, 0, 23))

tests/baselines/reference/importCallExpressionInSystem1.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpressionInSystem2.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ function foo(x: Promise<any>) {
3131

3232
foo(import("./0"));
3333
>foo : Symbol(foo, Decl(2.ts, 0, 0))
34+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
3435

tests/baselines/reference/importCallExpressionInSystem3.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ async function foo() {
1313
class C extends (await import("./0")).B {}
1414
>C : Symbol(C, Decl(2.ts, 0, 22))
1515
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
16+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
1617
>B : Symbol(B, Decl(0.ts, 0, 0))
1718

1819
var c = new C();

tests/baselines/reference/importCallExpressionInSystem4.symbols

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class C {
2222

2323
private myModule = import("./0");
2424
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
25+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2526

2627
method() {
2728
>method : Symbol(C.method, Decl(2.ts, 2, 37))
@@ -49,6 +50,7 @@ class C {
4950

5051
let one = await import("./1");
5152
>one : Symbol(one, Decl(2.ts, 8, 15))
53+
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
5254

5355
console.log(one.backup());
5456
>console : Symbol(console, Decl(2.ts, 0, 11))

tests/baselines/reference/importCallExpressionInUMD1.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
44

55
=== tests/cases/conformance/dynamicImport/1.ts ===
66
import("./0");
7+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
8+
79
var p1 = import("./0");
810
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
11+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
912

1013
p1.then(zero => {
1114
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
@@ -25,4 +28,5 @@ function foo() {
2528

2629
const p2 = import("./0");
2730
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
31+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2832
}

tests/baselines/reference/importCallExpressionInUMD2.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ function foo(x: Promise<any>) {
3131

3232
foo(import("./0"));
3333
>foo : Symbol(foo, Decl(2.ts, 0, 0))
34+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
3435

tests/baselines/reference/importCallExpressionInUMD3.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ async function foo() {
1313
class C extends (await import("./0")).B {}
1414
>C : Symbol(C, Decl(2.ts, 0, 22))
1515
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
16+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
1617
>B : Symbol(B, Decl(0.ts, 0, 0))
1718

1819
var c = new C();

tests/baselines/reference/importCallExpressionInUMD4.symbols

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class C {
2222

2323
private myModule = import("./0");
2424
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
25+
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
2526

2627
method() {
2728
>method : Symbol(C.method, Decl(2.ts, 2, 37))
@@ -49,6 +50,7 @@ class C {
4950

5051
let one = await import("./1");
5152
>one : Symbol(one, Decl(2.ts, 8, 15))
53+
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
5254

5355
console.log(one.backup());
5456
>console : Symbol(console, Decl(2.ts, 0, 11))
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
// @Filename: foo.ts
4+
//// export function foo() { return "foo"; }
5+
6+
//// import("[|./foo|]")
7+
//// var x = import("[|./foo|]")
8+
9+
verify.rangesReferenceEachOther();

0 commit comments

Comments
 (0)