mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #16406 from Microsoft/master-fix16402
[Master] Language Service on Dynamic import
This commit is contained in:
@@ -22645,14 +22645,12 @@ namespace ts {
|
||||
return undefined;
|
||||
|
||||
case SyntaxKind.StringLiteral:
|
||||
// External module name in an import declaration
|
||||
if ((isExternalModuleImportEqualsDeclaration(node.parent.parent) &&
|
||||
getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
|
||||
((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) &&
|
||||
(<ImportDeclaration>node.parent).moduleSpecifier === node)) {
|
||||
return resolveExternalModuleName(node, <LiteralExpression>node);
|
||||
}
|
||||
if (isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) {
|
||||
// 1). import x = require("./mo/*gotToDefinitionHere*/d")
|
||||
// 2). External module name in an import declaration
|
||||
// 3). Dynamic import call or require in javascript
|
||||
if ((isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
|
||||
((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) && (<ImportDeclaration>node.parent).moduleSpecifier === node) ||
|
||||
((isInJavaScriptFile(node) && isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || isImportCall(node.parent))) {
|
||||
return resolveExternalModuleName(node, <LiteralExpression>node);
|
||||
}
|
||||
// falls through
|
||||
|
||||
@@ -307,7 +307,7 @@ namespace ts.FindAllReferences.Core {
|
||||
case SyntaxKind.ExportDeclaration:
|
||||
return true;
|
||||
case SyntaxKind.CallExpression:
|
||||
return isRequireCall(node.parent as CallExpression, /*checkArgumentIsStringLiteral*/ false);
|
||||
return isRequireCall(node.parent as CallExpression, /*checkArgumentIsStringLiteral*/ false) || isImportCall(node.parent as CallExpression);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -30,4 +30,5 @@ function foo(x: Promise<any>) {
|
||||
|
||||
foo(import("./0"));
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
|
||||
@@ -22,6 +22,7 @@ class C {
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
@@ -49,6 +50,7 @@ class C {
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
|
||||
@@ -10,6 +10,7 @@ import * as Zero from "./0";
|
||||
>Zero : Symbol(Zero, Decl(1.ts, 1, 6))
|
||||
|
||||
import("./0");
|
||||
>"./0" : Symbol(Zero, Decl(0.ts, 0, 0))
|
||||
|
||||
export var p0: Promise<typeof Zero> = import(getPath());
|
||||
>p0 : Symbol(p0, Decl(1.ts, 4, 10))
|
||||
@@ -21,8 +22,10 @@ export var p1: Promise<typeof Zero> = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 5, 10))
|
||||
>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, --, --))
|
||||
>Zero : Symbol(Zero, Decl(1.ts, 1, 6))
|
||||
>"./0" : Symbol(Zero, Decl(0.ts, 0, 0))
|
||||
|
||||
export var p2: Promise<any> = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>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, --, --))
|
||||
>"./0" : Symbol(Zero, Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -31,4 +31,5 @@ function foo(x: Promise<any>) {
|
||||
|
||||
foo(import("./0"));
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
|
||||
@@ -22,6 +22,7 @@ class C {
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
@@ -49,6 +50,7 @@ class C {
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ async function compute(promise: Promise<any>) {
|
||||
|
||||
j = await import("./1");
|
||||
>j : Symbol(j, Decl(2.ts, 1, 7))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
return j.backup();
|
||||
>j : Symbol(j, Decl(2.ts, 1, 7))
|
||||
@@ -31,4 +32,5 @@ async function compute(promise: Promise<any>) {
|
||||
|
||||
compute(import("./0"));
|
||||
>compute : Symbol(compute, Decl(2.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -31,4 +31,5 @@ function foo(x: Promise<any>) {
|
||||
|
||||
foo(import("./0"));
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
|
||||
@@ -22,6 +22,7 @@ class C {
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
@@ -49,6 +50,7 @@ class C {
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
|
||||
@@ -5,6 +5,7 @@ export function foo() { return "foo"; }
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 0, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function arguments() { } // this is allow as the file doesn't have implicit "use strict"
|
||||
>arguments : Symbol(arguments, Decl(1.ts, 0, 23))
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -31,4 +31,5 @@ function foo(x: Promise<any>) {
|
||||
|
||||
foo(import("./0"));
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
|
||||
@@ -22,6 +22,7 @@ class C {
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
@@ -49,6 +50,7 @@ class C {
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
|
||||
@@ -4,8 +4,11 @@ export function foo() { return "foo"; }
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
@@ -25,4 +28,5 @@ function foo() {
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -31,4 +31,5 @@ function foo(x: Promise<any>) {
|
||||
|
||||
foo(import("./0"));
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
|
||||
@@ -22,6 +22,7 @@ class C {
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
@@ -49,6 +50,7 @@ class C {
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: foo.ts
|
||||
//// export function foo() { return "foo"; }
|
||||
|
||||
//// import("[|./foo|]")
|
||||
//// var x = import("[|./foo|]")
|
||||
|
||||
verify.rangesReferenceEachOther();
|
||||
@@ -0,0 +1,12 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: foo.ts
|
||||
//// export function [|bar|]() { return "bar"; }
|
||||
|
||||
//// var x = import("./foo");
|
||||
//// x.then(foo => {
|
||||
//// foo.[|bar|]();
|
||||
//// })
|
||||
|
||||
verify.rangesReferenceEachOther();
|
||||
verify.rangesAreRenameLocations();
|
||||
@@ -0,0 +1,10 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: foo.ts
|
||||
//// /*Destination*/export function foo() { return "foo"; }
|
||||
|
||||
//// import("./f/*1*/oo")
|
||||
//// var x = import("./fo/*2*/o")
|
||||
|
||||
verify.goToDefinition("1", "Destination");
|
||||
verify.goToDefinition("2", "Destination");
|
||||
@@ -0,0 +1,11 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: foo.ts
|
||||
//// export function /*Destination*/bar() { return "bar"; }
|
||||
|
||||
//// var x = import("./foo");
|
||||
//// x.then(foo => {
|
||||
//// foo.b/*1*/ar();
|
||||
//// })
|
||||
|
||||
verify.goToDefinition("1", "Destination");
|
||||
Reference in New Issue
Block a user