diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts
index 522577f9d8f87..8dcc7139fa6d3 100644
--- a/src/services/findAllReferences.ts
+++ b/src/services/findAllReferences.ts
@@ -1540,7 +1540,12 @@ export namespace Core {
break;
case ExportKind.Default:
// Search for a property access to '.default'. This can't be renamed.
- indirectSearch = state.options.use === FindReferencesUse.Rename ? undefined : state.createSearch(exportLocation, exportSymbol, ImportExport.Export, { text: "default" });
+ if (state.options.use !== FindReferencesUse.Rename) {
+ const allSearchSymbols = [exportSymbol];
+ const defaultExportSymbol = exportInfo.exportingModuleSymbol.exports?.get(InternalSymbolName.Default);
+ if (defaultExportSymbol && exportSymbol !== defaultExportSymbol) allSearchSymbols.push(defaultExportSymbol);
+ indirectSearch = state.createSearch(exportLocation, exportSymbol, ImportExport.Export, { text: "default", allSearchSymbols });
+ }
break;
case ExportKind.ExportEquals:
break;
diff --git a/tests/baselines/reference/findAllReferencesDynamicImport4.baseline.jsonc b/tests/baselines/reference/findAllReferencesDynamicImport4.baseline.jsonc
new file mode 100644
index 0000000000000..f848e5c33733e
--- /dev/null
+++ b/tests/baselines/reference/findAllReferencesDynamicImport4.baseline.jsonc
@@ -0,0 +1,723 @@
+// === findAllReferences ===
+// === /tests/cases/fourslash/definition.ts ===
+// <|export default function [|{| defId: 0, isWriteAccess: true, isDefinition: true |}X|]/*FIND ALL REFS*/() {}|>;
+
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 1, isWriteAccess: true |}X|] from "./definition";|>
+// [|{| defId: 1 |}X|];
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 0 |}default|];
+// await import("./definition").then((m) => m.[|{| defId: 0 |}default|]);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/definition.ts ===
+ // <|export default function [|{| defId: 0 |}X|]/*FIND ALL REFS*/() {}|>;
+
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 1 |}X|] from "./definition";|>
+ // X;
+ // async function asd() {
+ // const a = await import("./definition");
+ // --- (line: 5) skipped ---
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function X(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nimport X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 0, isWriteAccess: true, isDefinition: true |}X|]/*FIND ALL REFS*/ from "./definition";|>
+// [|{| defId: 0 |}X|];
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 1 |}default|];
+// await import("./definition").then((m) => m.[|{| defId: 1 |}default|]);
+// }
+
+// === /tests/cases/fourslash/definition.ts ===
+// <|export default function [|{| defId: 1, isWriteAccess: true |}X|]() {}|>;
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 0 |}X|]/*FIND ALL REFS*/ from "./definition";|>
+ // X;
+ // async function asd() {
+ // const a = await import("./definition");
+ // --- (line: 5) skipped ---
+
+ // === /tests/cases/fourslash/definition.ts ===
+ // <|export default function [|{| defId: 1 |}X|]() {}|>;
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nimport X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function X(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 0, isWriteAccess: true |}X|] from "./definition";|>
+// [|{| defId: 0 |}X|]/*FIND ALL REFS*/;
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 1 |}default|];
+// await import("./definition").then((m) => m.[|{| defId: 1 |}default|]);
+// }
+
+// === /tests/cases/fourslash/definition.ts ===
+// <|export default function [|{| defId: 1, isWriteAccess: true |}X|]() {}|>;
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 0 |}X|] from "./definition";|>
+ // X/*FIND ALL REFS*/;
+ // async function asd() {
+ // const a = await import("./definition");
+ // a.default;
+ // await import("./definition").then((m) => m.default);
+ // }
+
+ // === /tests/cases/fourslash/definition.ts ===
+ // <|export default function [|{| defId: 1 |}X|]() {}|>;
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nimport X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function X(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/definition.ts ===
+// <|export default function [|{| defId: 0, isWriteAccess: true |}X|]() {}|>;
+
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 1, isWriteAccess: true |}X|] from "./definition";|>
+// [|{| defId: 1 |}X|];
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 0 |}default|]/*FIND ALL REFS*/;
+// await import("./definition").then((m) => m.[|{| defId: 0 |}default|]);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/definition.ts ===
+ // <|export default function [|{| defId: 0 |}X|]() {}|>;
+
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 1 |}X|] from "./definition";|>
+ // X;
+ // async function asd() {
+ // const a = await import("./definition");
+ // a.default/*FIND ALL REFS*/;
+ // await import("./definition").then((m) => m.default);
+ // }
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function X(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nimport X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/definition.ts ===
+// <|export default function [|{| defId: 0, isWriteAccess: true |}X|]() {}|>;
+
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 1, isWriteAccess: true |}X|] from "./definition";|>
+// [|{| defId: 1 |}X|];
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 0 |}default|];
+// await import("./definition").then((m) => m.[|{| defId: 0 |}default|]/*FIND ALL REFS*/);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/definition.ts ===
+ // <|export default function [|{| defId: 0 |}X|]() {}|>;
+
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 1 |}X|] from "./definition";|>
+ // X;
+ // async function asd() {
+ // const a = await import("./definition");
+ // a.default;
+ // await import("./definition").then((m) => m.default/*FIND ALL REFS*/);
+ // }
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function X(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nimport X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllReferencesDynamicImport5.baseline.jsonc b/tests/baselines/reference/findAllReferencesDynamicImport5.baseline.jsonc
new file mode 100644
index 0000000000000..53d9dd2e57e7a
--- /dev/null
+++ b/tests/baselines/reference/findAllReferencesDynamicImport5.baseline.jsonc
@@ -0,0 +1,1021 @@
+// === findAllReferences ===
+// === /tests/cases/fourslash/definition.ts ===
+// <|function [|{| defId: 0, isWriteAccess: true, isDefinition: true |}X|]/*FIND ALL REFS*/() {}|>
+// <|export default [|{| defId: 0 |}X|];|>
+
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 1, isWriteAccess: true |}Y|] from "./definition";|>
+// [|{| defId: 1 |}Y|];
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 2 |}default|];
+// await import("./definition").then((m) => m.[|{| defId: 2 |}default|]);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/definition.ts ===
+ // <|function [|{| defId: 0 |}X|]/*FIND ALL REFS*/() {}|>
+ // <|export default [|{| defId: 2 |}X|];|>
+
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 1 |}Y|] from "./definition";|>
+ // Y;
+ // async function asd() {
+ // const a = await import("./definition");
+ // --- (line: 5) skipped ---
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function X(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function Y(): void\nimport Y",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 2,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nexport default X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "export",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "default",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/definition.ts ===
+// <|function [|{| defId: 0, isWriteAccess: true |}X|]() {}|>
+// <|export default [|{| defId: 0 |}X|]/*FIND ALL REFS*/;|>
+
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 1, isWriteAccess: true |}Y|] from "./definition";|>
+// [|{| defId: 1 |}Y|];
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 2 |}default|];
+// await import("./definition").then((m) => m.[|{| defId: 2 |}default|]);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/definition.ts ===
+ // <|function [|{| defId: 0 |}X|]() {}|>
+ // <|export default [|{| defId: 2 |}X|]/*FIND ALL REFS*/;|>
+
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 1 |}Y|] from "./definition";|>
+ // Y;
+ // async function asd() {
+ // const a = await import("./definition");
+ // --- (line: 5) skipped ---
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function X(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function Y(): void\nimport Y",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 2,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nexport default X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "export",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "default",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| isWriteAccess: true, isDefinition: true |}Y|]/*FIND ALL REFS*/ from "./definition";|>
+// [|Y|];
+// async function asd() {
+// const a = await import("./definition");
+// a.default;
+// await import("./definition").then((m) => m.default);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|Y|]/*FIND ALL REFS*/ from "./definition";|>
+ // Y;
+ // async function asd() {
+ // const a = await import("./definition");
+ // --- (line: 5) skipped ---
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function Y(): void\nimport Y",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| isWriteAccess: true |}Y|] from "./definition";|>
+// [|Y|]/*FIND ALL REFS*/;
+// async function asd() {
+// const a = await import("./definition");
+// a.default;
+// await import("./definition").then((m) => m.default);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|Y|] from "./definition";|>
+ // Y/*FIND ALL REFS*/;
+ // async function asd() {
+ // const a = await import("./definition");
+ // a.default;
+ // await import("./definition").then((m) => m.default);
+ // }
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function Y(): void\nimport Y",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/definition.ts ===
+// function X() {}
+// <|export [|{| defId: 0, isWriteAccess: true |}default|] X;|>
+
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 1, isWriteAccess: true |}Y|] from "./definition";|>
+// [|{| defId: 1 |}Y|];
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 0 |}default|]/*FIND ALL REFS*/;
+// await import("./definition").then((m) => m.[|{| defId: 0 |}default|]);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/definition.ts ===
+ // function X() {}
+ // <|export default [|{| defId: 0 |}X|];|>
+
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 1 |}Y|] from "./definition";|>
+ // Y;
+ // async function asd() {
+ // const a = await import("./definition");
+ // a.default/*FIND ALL REFS*/;
+ // await import("./definition").then((m) => m.default);
+ // }
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nexport default X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "export",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "default",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function Y(): void\nimport Y",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /tests/cases/fourslash/definition.ts ===
+// function X() {}
+// <|export [|{| defId: 0, isWriteAccess: true |}default|] X;|>
+
+// === /tests/cases/fourslash/usage.ts ===
+// <|import [|{| defId: 1, isWriteAccess: true |}Y|] from "./definition";|>
+// [|{| defId: 1 |}Y|];
+// async function asd() {
+// const a = await import("./definition");
+// a.[|{| defId: 0 |}default|];
+// await import("./definition").then((m) => m.[|{| defId: 0 |}default|]/*FIND ALL REFS*/);
+// }
+
+ // === Definitions ===
+ // === /tests/cases/fourslash/definition.ts ===
+ // function X() {}
+ // <|export default [|{| defId: 0 |}X|];|>
+
+ // === /tests/cases/fourslash/usage.ts ===
+ // <|import [|{| defId: 1 |}Y|] from "./definition";|>
+ // Y;
+ // async function asd() {
+ // const a = await import("./definition");
+ // a.default;
+ // await import("./definition").then((m) => m.default/*FIND ALL REFS*/);
+ // }
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function X(): void\nexport default X",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "export",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "default",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "X",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function Y(): void\nimport Y",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Y",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/cases/fourslash/findAllReferencesDynamicImport4.ts b/tests/cases/fourslash/findAllReferencesDynamicImport4.ts
new file mode 100644
index 0000000000000..f3f259b39bb3e
--- /dev/null
+++ b/tests/cases/fourslash/findAllReferencesDynamicImport4.ts
@@ -0,0 +1,17 @@
+///
+
+// @strict: true
+
+// @Filename: definition.ts
+//// export default function X/*1*/() {};
+
+// @Filename: usage.ts
+//// import X/*2*/ from "./definition";
+//// X/*3*/;
+//// async function asd() {
+//// const a = await import("./definition");
+//// a.default/*4*/;
+//// await import("./definition").then((m) => m.default/*5*/);
+//// }
+
+verify.baselineFindAllReferences('1', '2', '3', '4', '5');
diff --git a/tests/cases/fourslash/findAllReferencesDynamicImport5.ts b/tests/cases/fourslash/findAllReferencesDynamicImport5.ts
new file mode 100644
index 0000000000000..7ca5e84ee7581
--- /dev/null
+++ b/tests/cases/fourslash/findAllReferencesDynamicImport5.ts
@@ -0,0 +1,18 @@
+///
+
+// @strict: true
+
+// @Filename: definition.ts
+//// function X/*1*/() {}
+//// export default X/*2*/;
+
+// @Filename: usage.ts
+//// import Y/*3*/ from "./definition";
+//// Y/*4*/;
+//// async function asd() {
+//// const a = await import("./definition");
+//// a.default/*5*/;
+//// await import("./definition").then((m) => m.default/*6*/);
+//// }
+
+verify.baselineFindAllReferences('1', '2', '3', '4', '5', '6');