Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -30272,7 +30272,7 @@ func (c *Checker) getSymbolAtLocation(node *ast.Node, ignoreErrors bool) *ast.Sy
// 4). type A = import("./f/*gotToDefinitionHere*/oo")
if (ast.IsExternalModuleImportEqualsDeclaration(grandParent) && ast.GetExternalModuleImportEqualsDeclarationExpression(grandParent) == node) ||
((parent.Kind == ast.KindImportDeclaration || parent.Kind == ast.KindJSImportDeclaration || parent.Kind == ast.KindExportDeclaration) && ast.GetExternalModuleName(parent) == node) ||
ast.IsVariableDeclarationInitializedToRequire(grandParent) ||
ast.IsVariableDeclarationInitializedToRequire(grandParent) || ast.IsImportCall(parent) ||
(ast.IsLiteralTypeNode(parent) && ast.IsLiteralImportTypeNode(grandParent) && grandParent.AsImportTypeNode().Argument == parent) {
return c.resolveExternalModuleName(node, node, ignoreErrors)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// === goToDefinition ===
// === /foo.ts ===

// export function foo() { return "foo"; }
// [|export function foo() { return "foo"; }
// import("./f/*GO TO DEFINITION*/oo")
// var x = import("./foo")
// var x = import("./foo")|]




// === goToDefinition ===
// === /foo.ts ===

// export function foo() { return "foo"; }
// [|export function foo() { return "foo"; }
// import("./foo")
// var x = import("./fo/*GO TO DEFINITION*/o")
// var x = import("./fo/*GO TO DEFINITION*/o")|]
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function a() {}
export const x = add(import("./sub"));
>x : Symbol(x, Decl(index.ts, 0, 12))
>add : Symbol(add, Decl(index.ts, 1, 27))
>"./sub" : Symbol("sub", Decl(sub.ts, 0, 0))

export * as Q from "./sub";
>Q : Symbol(Q, Decl(index.ts, 1, 6))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default (suit: Suit, rank: Rank) => ({suit, rank});
export let lazyCard = () => import('./Card').then(a => a.default);
>lazyCard : Symbol(lazyCard, Decl(index.ts, 0, 10))
>import('./Card').then : Symbol(then, Decl(lib.es5.d.ts, --, --))
>'./Card' : Symbol("Card", Decl(Card.ts, 0, 0))
>then : Symbol(then, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(index.ts, 0, 50))
>a.default : Symbol(default, Decl(Card.ts, 0, 37))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
export let lazyCard = () => import('./Card').then(a => a.default);
>lazyCard : Symbol(lazyCard, Decl(index.ts, 0, 10))
->import('./Card').then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
->'./Card' : Symbol("Card", Decl(Card.ts, 0, 0))
->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
+>import('./Card').then : Symbol(then, Decl(lib.es5.d.ts, --, --))
>'./Card' : Symbol("Card", Decl(Card.ts, 0, 0))
->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
+>then : Symbol(then, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(index.ts, 0, 50))
>a.default : Symbol(default, Decl(Card.ts, 0, 37))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ export const mod = await (async () => {

case 0:
return await import("./case0.js");
>"./case0.js" : Symbol("/case0", Decl(case0.ts, 0, 0))

case 1:
return await import("./case1.js");
>"./case1.js" : Symbol("/case1", Decl(case1.ts, 0, 0))

default:
return await import("./caseFallback.js");
>"./caseFallback.js" : Symbol("/caseFallback", Decl(caseFallback.ts, 0, 0))
}
})();

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export = x;
>x : Symbol(x, Decl(a.ts, 0, 10))

import("./a");
>"./a" : Symbol("/a", Decl(a.ts, 0, 0))

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export = foo;
=== index.ts ===
import("./foo").then(f => {
>import("./foo").then : Symbol(then, Decl(lib.es5.d.ts, --, --))
>"./foo" : Symbol("foo", Decl(foo.d.ts, 0, 0))
>then : Symbol(then, Decl(lib.es5.d.ts, --, --))
>f : Symbol(f, Decl(index.ts, 0, 21))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
=== index.ts ===
import("./foo").then(f => {
->import("./foo").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
->"./foo" : Symbol("foo", Decl(foo.d.ts, 0, 0))
->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
+>import("./foo").then : Symbol(then, Decl(lib.es5.d.ts, --, --))
>"./foo" : Symbol("foo", Decl(foo.d.ts, 0, 0))
->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
+>then : Symbol(then, Decl(lib.es5.d.ts, --, --))
>f : Symbol(f, Decl(index.ts, 0, 21))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mdast.toString();

const mdast2 = await import('mdast-util-to-string');
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
>'mdast-util-to-string' : Symbol("/node_modules/mdast-util-to-string/index", Decl(index.d.ts, 0, 0))

mdast2.toString();
>mdast2.toString : Symbol(toString, Decl(index.d.ts, 0, 0))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mdast.toString();

const mdast2 = await import('mdast-util-to-string');
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
>'mdast-util-to-string' : Symbol("/node_modules/mdast-util-to-string/index", Decl(index.d.ts, 0, 0))

mdast2.toString();
>mdast2.toString : Symbol(toString, Decl(index.d.ts, 0, 0))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
export async function foo({ foo = await import("./bar") }) {
>foo : Symbol(foo, Decl(bar.ts, 0, 0))
>foo : Symbol(foo, Decl(bar.ts, 0, 27))
>"./bar" : Symbol("bar", Decl(bar.ts, 0, 0))
}

export function* foo2({ foo = yield "a" }) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
=== /a.ts ===
const foo = import("./b");
>foo : Symbol(foo, Decl(a.ts, 0, 5))
>"./b" : Symbol("/b", Decl(b.js, 0, 0))

=== /b.js ===

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
=== /a.ts ===
const foo = import("./b");
>foo : Symbol(foo, Decl(a.ts, 0, 5))
>"./b" : Symbol("/b", Decl(b.js, 0, 0))

=== /b.js ===

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const a2 = require("./a"); // Error in TS

const a3 = await import("./a"); // { x: 0 }
>a3 : Symbol(a3, Decl(main1.ts, 3, 5))
>"./a" : Symbol("/a", Decl(a.js, 0, 0))

a3.x;
>a3.x : Symbol(x, Decl(a.js, 0, 12))
Expand All @@ -72,6 +73,7 @@ b2.default;

const b3 = await import("./b"); // { default: 0 }
>b3 : Symbol(b3, Decl(main1.ts, 9, 5))
>"./b" : Symbol("/b", Decl(b.ts, 0, 0))

b3.default;
>b3.default : Symbol(default, Decl(b.ts, 0, 0))
Expand Down Expand Up @@ -103,6 +105,7 @@ d2.default(); // Error

const d3 = await import("./d"); // { default: [Function: default] }
>d3 : Symbol(d3, Decl(main1.ts, 19, 5))
>"./d" : Symbol("/d", Decl(d.ts, 0, 0))

d3.default();
>d3.default : Symbol(default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
const a3 = await import("./a"); // { x: 0 }
>a3 : Symbol(a3, Decl(main1.ts, 3, 5))
->"./a" : Symbol(a1, Decl(a.js, 0, 0))
+>"./a" : Symbol("/a", Decl(a.js, 0, 0))

a3.x;
>a3.x : Symbol(x, Decl(a.js, 0, 12))
@@= skipped -14, +13 lines =@@
@@= skipped -14, +14 lines =@@
>b2 : Symbol(b2, Decl(main1.ts, 6, 21))

b2.default;
Expand All @@ -42,6 +43,7 @@
const b3 = await import("./b"); // { default: 0 }
>b3 : Symbol(b3, Decl(main1.ts, 9, 5))
->"./b" : Symbol(b2, Decl(b.ts, 0, 0))
+>"./b" : Symbol("/b", Decl(b.ts, 0, 0))

b3.default;
->b3.default : Symbol(b1, Decl(b.ts, 0, 0))
Expand All @@ -52,15 +54,7 @@

import c1 from "./c"; // { default: [Function: default] }
>c1 : Symbol(c1, Decl(main1.ts, 12, 6))
@@= skipped -38, +37 lines =@@

const d3 = await import("./d"); // { default: [Function: default] }
>d3 : Symbol(d3, Decl(main1.ts, 19, 5))
->"./d" : Symbol("/d", Decl(d.ts, 0, 0))

d3.default();
>d3.default : Symbol(default)
@@= skipped -20, +19 lines =@@
@@= skipped -58, +58 lines =@@
>f2 : Symbol(f2, Decl(main1.ts, 24, 25))

f2.default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type LocalInterface =

& import("pkg", { assert: {1234, "resolution-mode": "require"} }).RequireInterface
& import("pkg", { assert: {1234, "resolution-mode": "import"} }).ImportInterface;
>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0))
>assert : Symbol(assert, Decl(index.ts, 2, 21))
>1234 : Symbol(1234, Decl(index.ts, 2, 31))
>"resolution-mode" : Symbol("resolution-mode", Decl(index.ts, 2, 36))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type LocalInterface =

& import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface
& import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface;
>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0))
>with : Symbol(with, Decl(index.ts, 2, 21))
>1234 : Symbol(1234, Decl(index.ts, 2, 29))
>"resolution-mode" : Symbol("resolution-mode", Decl(index.ts, 2, 34))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type __A = import("./a.ts").A; // ok

const aPromise = import("./a.ts"); // error
>aPromise : Symbol(aPromise, Decl(b.ts, 4, 5))
>"./a.ts" : Symbol("a", Decl(a.ts, 0, 0))

=== c.ts ===
import type { A } from "./a.d.ts"; // ok
Expand All @@ -39,4 +40,5 @@ type __A = import("./a.d.ts").A; // ok

const aPromise = import("./a.d.ts"); // error
>aPromise : Symbol(aPromise, Decl(c.ts, 4, 5))
>"./a.d.ts" : Symbol("a", Decl(a.ts, 0, 0))

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ declare module "path" {
=== /mainJs.js ===
import {} from "./a";
import("./a");
>"./a" : Symbol("/a", Decl(a.ts, 0, 0))

const _ = require("./a");
>_ : Symbol(_, Decl(mainJs.js, 2, 5))
>require : Symbol(require, Decl(index.d.ts, 0, 11))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import {} from "./a";
import("./a");
->"./a" : Symbol(_, Decl(a.ts, 0, 0))
-
+>"./a" : Symbol("/a", Decl(a.ts, 0, 0))

const _ = require("./a");
>_ : Symbol(_, Decl(mainJs.js, 2, 5))
>require : Symbol(require, Decl(index.d.ts, 0, 11))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ declare module "path" {
=== /mainJs.js ===
import {} from "./a";
import("./a");
>"./a" : Symbol("/a", Decl(a.ts, 0, 0))

const _ = require("./a");
>_ : Symbol(_, Decl(mainJs.js, 2, 5))
>require : Symbol(require, Decl(index.d.ts, 0, 11))
Expand Down
Loading
Loading