diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts
index a2ed0feb795a7..7320c6d3074f0 100644
--- a/src/services/findAllReferences.ts
+++ b/src/services/findAllReferences.ts
@@ -1474,7 +1474,15 @@ export namespace Core {
} = searchOptions;
const escapedText = escapeLeadingUnderscores(text);
const parents = this.options.implementations && location ? getParentSymbolsOfPropertyAccess(location, symbol, this.checker) : undefined;
- return { symbol, comingFrom, text, escapedText, parents, allSearchSymbols, includes: sym => contains(allSearchSymbols, sym) };
+ return {
+ symbol,
+ comingFrom,
+ text,
+ escapedText,
+ parents,
+ allSearchSymbols,
+ includes: sym => contains(allSearchSymbols, sym, (s1, s2) => this.checker.getMergedSymbol(s1) === this.checker.getMergedSymbol(s2)),
+ };
}
private readonly symbolIdToReferences: Entry[][] = [];
diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts
index 316d3874fb40e..33c6ff364061e 100644
--- a/src/services/importTracker.ts
+++ b/src/services/importTracker.ts
@@ -21,6 +21,7 @@ import {
getNameOfAccessExpression,
getSourceFileOfNode,
getSymbolId,
+ getSymbolTarget,
hasSyntacticModifier,
Identifier,
ImportCall,
@@ -635,6 +636,16 @@ export function getImportOrExportSymbol(node: Node, symbol: Symbol, checker: Typ
else if (isJSDocTypedefTag(parent) || isJSDocCallbackTag(parent)) {
return exportInfo(symbol, ExportKind.Named);
}
+ else {
+ const sourceFile = getSourceFileOfNode(node);
+ if (sourceFile.symbol?.exports?.has(InternalSymbolName.ExportEquals)) {
+ const moduleSymbol = checker.resolveExternalModuleSymbol(sourceFile.symbol);
+ if (moduleSymbol && (moduleSymbol === symbol.parent || some(checker.getPropertiesOfType(checker.getTypeOfSymbol(moduleSymbol)), s => getSymbolTarget(s, checker) === symbol))) {
+ const exportInfo = { exportingModuleSymbol: sourceFile.symbol, exportKind: ExportKind.Named };
+ return { kind: ImportExport.Export, symbol, exportInfo };
+ }
+ }
+ }
}
function getExportAssignmentExport(ex: ExportAssignment): ExportedSymbol | undefined {
diff --git a/tests/baselines/reference/findAllRefsDefaultExportedClassInstanceMember1.baseline.jsonc b/tests/baselines/reference/findAllRefsDefaultExportedClassInstanceMember1.baseline.jsonc
new file mode 100644
index 0000000000000..8089bd1a55d76
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsDefaultExportedClassInstanceMember1.baseline.jsonc
@@ -0,0 +1,161 @@
+// === findAllReferences ===
+// === /mod.ts ===
+// class Cls {
+// /*FIND ALL REFS*/<|[|{| isWriteAccess: true, isDefinition: true |}foo|]() {}|>
+// };
+//
+// export default new Cls();
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|foo|]();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // class Cls {
+ // /*FIND ALL REFS*/<|[|foo|]() {}|>
+ // };
+ //
+ // export default new Cls();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "method",
+ "name": "(method) Cls.foo(): void",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "method",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Cls",
+ "kind": "className"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "foo",
+ "kind": "methodName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /mod.ts ===
+// class Cls {
+// <|[|{| isWriteAccess: true |}foo|]() {}|>
+// };
+//
+// export default new Cls();
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|foo|]/*FIND ALL REFS*/();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // class Cls {
+ // <|[|foo|]() {}|>
+ // };
+ //
+ // export default new Cls();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "method",
+ "name": "(method) Cls.foo(): void",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "method",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Cls",
+ "kind": "className"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "foo",
+ "kind": "methodName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember1.baseline.jsonc b/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember1.baseline.jsonc
new file mode 100644
index 0000000000000..631a17ffa4f59
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember1.baseline.jsonc
@@ -0,0 +1,145 @@
+// === findAllReferences ===
+// === /mod.d.ts ===
+// export default React;
+//
+// declare namespace React {
+// <|function /*FIND ALL REFS*/[|{| isWriteAccess: true, isDefinition: true |}lazy|](): void;|>
+// }
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|lazy|]();
+
+ // === Definitions ===
+ // === /mod.d.ts ===
+ // export default React;
+ //
+ // declare namespace React {
+ // <|function /*FIND ALL REFS*/[|lazy|](): void;|>
+ // }
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function React.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "React",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /mod.d.ts ===
+// export default React;
+//
+// declare namespace React {
+// <|function [|{| isWriteAccess: true |}lazy|](): void;|>
+// }
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|lazy|]/*FIND ALL REFS*/();
+
+ // === Definitions ===
+ // === /mod.d.ts ===
+ // export default React;
+ //
+ // declare namespace React {
+ // <|function [|lazy|](): void;|>
+ // }
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function React.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "React",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember2.baseline.jsonc b/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember2.baseline.jsonc
new file mode 100644
index 0000000000000..68c0f4cf84bd5
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember2.baseline.jsonc
@@ -0,0 +1,169 @@
+// === findAllReferences ===
+// === /mod.d.ts ===
+// export default Outer.Inner;
+//
+// declare namespace Outer {
+// namespace Inner {
+// <|function /*FIND ALL REFS*/[|{| isWriteAccess: true, isDefinition: true |}lazy|](): void;|>
+// }
+// }
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|lazy|]();
+
+ // === Definitions ===
+ // === /mod.d.ts ===
+ // export default Outer.Inner;
+ //
+ // declare namespace Outer {
+ // namespace Inner {
+ // <|function /*FIND ALL REFS*/[|lazy|](): void;|>
+ // }
+ // }
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function Outer.Inner.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Outer",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "Inner",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /mod.d.ts ===
+// export default Outer.Inner;
+//
+// declare namespace Outer {
+// namespace Inner {
+// <|function [|{| isWriteAccess: true |}lazy|](): void;|>
+// }
+// }
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|lazy|]/*FIND ALL REFS*/();
+
+ // === Definitions ===
+ // === /mod.d.ts ===
+ // export default Outer.Inner;
+ //
+ // declare namespace Outer {
+ // namespace Inner {
+ // <|function [|lazy|](): void;|>
+ // }
+ // }
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function Outer.Inner.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Outer",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "Inner",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember3.baseline.jsonc b/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember3.baseline.jsonc
new file mode 100644
index 0000000000000..f152e00fe3c94
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsDefaultExportedNamespaceMember3.baseline.jsonc
@@ -0,0 +1,66 @@
+// === findAllReferences ===
+// === /mod.ts ===
+// export default Ns;
+//
+// namespace Ns {
+// <|function /*FIND ALL REFS*/[|{| isWriteAccess: true, isDefinition: true |}lazy|]() {}|> // this *isn't* exported from the namespace
+// }
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // export default Ns;
+ //
+ // namespace Ns {
+ // <|function /*FIND ALL REFS*/[|lazy|]() {}|> // this *isn't* exported from the namespace
+ // }
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// import def from "./mod"
+// def.lazy/*FIND ALL REFS*/();
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsDefaultExportedObjectMember1.baseline.jsonc b/tests/baselines/reference/findAllRefsDefaultExportedObjectMember1.baseline.jsonc
new file mode 100644
index 0000000000000..2680dc2247eee
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsDefaultExportedObjectMember1.baseline.jsonc
@@ -0,0 +1,169 @@
+// === findAllReferences ===
+// === /mod.ts ===
+// const obj = {
+// /*FIND ALL REFS*/<|[|{| isWriteAccess: true, isDefinition: true |}foo|]: () => ""|>,
+// };
+//
+// export default obj;
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|foo|]();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // const obj = {
+ // /*FIND ALL REFS*/<|[|foo|]: () => ""|>,
+ // };
+ //
+ // export default obj;
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "property",
+ "name": "(property) foo: () => string",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "propertyName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /mod.ts ===
+// const obj = {
+// <|[|{| isWriteAccess: true |}foo|]: () => ""|>,
+// };
+//
+// export default obj;
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|foo|]/*FIND ALL REFS*/();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // const obj = {
+ // <|[|foo|]: () => ""|>,
+ // };
+ //
+ // export default obj;
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "property",
+ "name": "(property) foo: () => string",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "propertyName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsDefaultExportedObjectMember2.baseline.jsonc b/tests/baselines/reference/findAllRefsDefaultExportedObjectMember2.baseline.jsonc
new file mode 100644
index 0000000000000..16726b70a4795
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsDefaultExportedObjectMember2.baseline.jsonc
@@ -0,0 +1,177 @@
+// === findAllReferences ===
+// === /mod.ts ===
+// const obj = {
+// nested: {
+// /*FIND ALL REFS*/<|[|{| isWriteAccess: true, isDefinition: true |}foo|]: () => ""|>,
+// },
+// };
+//
+// export default obj.nested;
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|foo|]();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // const obj = {
+ // nested: {
+ // /*FIND ALL REFS*/<|[|foo|]: () => ""|>,
+ // },
+ // };
+ //
+ // export default obj.nested;
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "property",
+ "name": "(property) foo: () => string",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "propertyName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /mod.ts ===
+// const obj = {
+// nested: {
+// <|[|{| isWriteAccess: true |}foo|]: () => ""|>,
+// },
+// };
+//
+// export default obj.nested;
+
+// === /index.ts ===
+// import def from "./mod"
+// def.[|foo|]/*FIND ALL REFS*/();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // const obj = {
+ // nested: {
+ // <|[|foo|]: () => ""|>,
+ // },
+ // };
+ //
+ // export default obj.nested;
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "property",
+ "name": "(property) foo: () => string",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "propertyName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsEqualExportedClassInstanceMember1.baseline.jsonc b/tests/baselines/reference/findAllRefsEqualExportedClassInstanceMember1.baseline.jsonc
new file mode 100644
index 0000000000000..160bd2ed51b96
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsEqualExportedClassInstanceMember1.baseline.jsonc
@@ -0,0 +1,357 @@
+// === findAllReferences ===
+// === /mod.ts ===
+// class Cls {
+// /*FIND ALL REFS*/<|[|{| defId: 0, isWriteAccess: true, isDefinition: true |}foo|]() {}|>
+// };
+//
+// export = new Cls();
+
+// === /index.ts ===
+// <|import { [|{| defId: 1, isWriteAccess: true |}foo|] } from "./mod"|>
+// [|{| defId: 1 |}foo|]();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // class Cls {
+ // /*FIND ALL REFS*/<|[|{| defId: 0 |}foo|]() {}|>
+ // };
+ //
+ // export = new Cls();
+
+ // === /index.ts ===
+ // <|import { [|{| defId: 1 |}foo|] } from "./mod"|>
+ // foo();
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "method",
+ "name": "(method) Cls.foo(): void",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "method",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Cls",
+ "kind": "className"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "foo",
+ "kind": "methodName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (method) foo(): void\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "method",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "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": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { /*FIND ALL REFS*/[|{| isWriteAccess: true, isDefinition: true |}foo|] } from "./mod"|>
+// [|foo|]();
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { /*FIND ALL REFS*/[|foo|] } from "./mod"|>
+ // foo();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (method) foo(): void\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "method",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "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": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { [|{| isWriteAccess: true |}foo|] } from "./mod"|>
+// /*FIND ALL REFS*/[|foo|]();
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { [|foo|] } from "./mod"|>
+ // /*FIND ALL REFS*/foo();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (method) foo(): void\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "method",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "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": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember1.baseline.jsonc b/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember1.baseline.jsonc
new file mode 100644
index 0000000000000..297a5e0dff41d
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember1.baseline.jsonc
@@ -0,0 +1,453 @@
+// === findAllReferences ===
+// === /mod.d.ts ===
+// export = React;
+//
+// declare namespace React {
+// <|function /*FIND ALL REFS*/[|{| defId: 0, isWriteAccess: true, isDefinition: true |}lazy|](): void;|>
+// }
+
+// === /index.ts ===
+// <|import { [|{| defId: 1, isWriteAccess: true |}lazy|] } from "./mod"|>
+// [|{| defId: 1 |}lazy|]();
+
+ // === Definitions ===
+ // === /mod.d.ts ===
+ // export = React;
+ //
+ // declare namespace React {
+ // <|function /*FIND ALL REFS*/[|{| defId: 0 |}lazy|](): void;|>
+ // }
+
+ // === /index.ts ===
+ // <|import { [|{| defId: 1 |}lazy|] } from "./mod"|>
+ // lazy();
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function React.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "React",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "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 lazy(): void\nimport lazy",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "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": "lazy",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { /*FIND ALL REFS*/[|{| defId: 0, isWriteAccess: true, isDefinition: true |}lazy|] } from "./mod"|>
+// [|{| defId: 0 |}lazy|]();
+
+// === /mod.d.ts ===
+// export = React;
+//
+// declare namespace React {
+// <|function [|{| defId: 1, isWriteAccess: true |}lazy|](): void;|>
+// }
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { /*FIND ALL REFS*/[|{| defId: 0 |}lazy|] } from "./mod"|>
+ // lazy();
+
+ // === /mod.d.ts ===
+ // export = React;
+ //
+ // declare namespace React {
+ // <|function [|{| defId: 1 |}lazy|](): void;|>
+ // }
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function lazy(): void\nimport lazy",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "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": "lazy",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function React.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "React",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { [|{| defId: 0, isWriteAccess: true |}lazy|] } from "./mod"|>
+// /*FIND ALL REFS*/[|{| defId: 0 |}lazy|]();
+
+// === /mod.d.ts ===
+// export = React;
+//
+// declare namespace React {
+// <|function [|{| defId: 1, isWriteAccess: true |}lazy|](): void;|>
+// }
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { [|{| defId: 0 |}lazy|] } from "./mod"|>
+ // /*FIND ALL REFS*/lazy();
+
+ // === /mod.d.ts ===
+ // export = React;
+ //
+ // declare namespace React {
+ // <|function [|{| defId: 1 |}lazy|](): void;|>
+ // }
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function lazy(): void\nimport lazy",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "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": "lazy",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function React.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "React",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember2.baseline.jsonc b/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember2.baseline.jsonc
new file mode 100644
index 0000000000000..43a208052696c
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember2.baseline.jsonc
@@ -0,0 +1,489 @@
+// === findAllReferences ===
+// === /mod.d.ts ===
+// export = Outer.Inner;
+//
+// declare namespace Outer {
+// namespace Inner {
+// <|function /*FIND ALL REFS*/[|{| defId: 0, isWriteAccess: true, isDefinition: true |}lazy|](): void;|>
+// }
+// }
+
+// === /index.ts ===
+// <|import { [|{| defId: 1, isWriteAccess: true |}lazy|] } from "./mod"|>
+// [|{| defId: 1 |}lazy|]();
+
+ // === Definitions ===
+ // === /mod.d.ts ===
+ // export = Outer.Inner;
+ //
+ // declare namespace Outer {
+ // namespace Inner {
+ // <|function /*FIND ALL REFS*/[|{| defId: 0 |}lazy|](): void;|>
+ // }
+ // }
+
+ // === /index.ts ===
+ // <|import { [|{| defId: 1 |}lazy|] } from "./mod"|>
+ // lazy();
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function Outer.Inner.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Outer",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "Inner",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "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 lazy(): void\nimport lazy",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "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": "lazy",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { /*FIND ALL REFS*/[|{| defId: 0, isWriteAccess: true, isDefinition: true |}lazy|] } from "./mod"|>
+// [|{| defId: 0 |}lazy|]();
+
+// === /mod.d.ts ===
+// export = Outer.Inner;
+//
+// declare namespace Outer {
+// namespace Inner {
+// <|function [|{| defId: 1, isWriteAccess: true |}lazy|](): void;|>
+// }
+// }
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { /*FIND ALL REFS*/[|{| defId: 0 |}lazy|] } from "./mod"|>
+ // lazy();
+
+ // === /mod.d.ts ===
+ // export = Outer.Inner;
+ //
+ // declare namespace Outer {
+ // namespace Inner {
+ // <|function [|{| defId: 1 |}lazy|](): void;|>
+ // }
+ // }
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function lazy(): void\nimport lazy",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "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": "lazy",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function Outer.Inner.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Outer",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "Inner",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { [|{| defId: 0, isWriteAccess: true |}lazy|] } from "./mod"|>
+// /*FIND ALL REFS*/[|{| defId: 0 |}lazy|]();
+
+// === /mod.d.ts ===
+// export = Outer.Inner;
+//
+// declare namespace Outer {
+// namespace Inner {
+// <|function [|{| defId: 1, isWriteAccess: true |}lazy|](): void;|>
+// }
+// }
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { [|{| defId: 0 |}lazy|] } from "./mod"|>
+ // /*FIND ALL REFS*/lazy();
+
+ // === /mod.d.ts ===
+ // export = Outer.Inner;
+ //
+ // declare namespace Outer {
+ // namespace Inner {
+ // <|function [|{| defId: 1 |}lazy|](): void;|>
+ // }
+ // }
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) function lazy(): void\nimport lazy",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "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": "lazy",
+ "kind": "aliasName"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function Outer.Inner.lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "Outer",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "Inner",
+ "kind": "moduleName"
+ },
+ {
+ "text": ".",
+ "kind": "punctuation"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember3.baseline.jsonc b/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember3.baseline.jsonc
new file mode 100644
index 0000000000000..5d663ab9fa855
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsEqualExportedNamespaceMember3.baseline.jsonc
@@ -0,0 +1,131 @@
+// === findAllReferences ===
+// === /mod.ts ===
+// export = Ns;
+//
+// namespace Ns {
+// <|function /*FIND ALL REFS*/[|{| isWriteAccess: true, isDefinition: true |}lazy|]() {}|> // this *isn't* exported from the namespace
+// }
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // export = Ns;
+ //
+ // namespace Ns {
+ // <|function /*FIND ALL REFS*/[|lazy|]() {}|> // this *isn't* exported from the namespace
+ // }
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "function",
+ "name": "function lazy(): void",
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "void",
+ "kind": "keyword"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { /*FIND ALL REFS*/[|{| isWriteAccess: true, isDefinition: true |}lazy|] } from "./mod"|>
+// [|lazy|]();
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { /*FIND ALL REFS*/[|lazy|] } from "./mod"|>
+ // lazy();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "import lazy",
+ "displayParts": [
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { [|{| isWriteAccess: true |}lazy|] } from "./mod"|>
+// /*FIND ALL REFS*/[|lazy|]();
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { [|lazy|] } from "./mod"|>
+ // /*FIND ALL REFS*/lazy();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "import lazy",
+ "displayParts": [
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "lazy",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsEqualExportedObjectMember1.baseline.jsonc b/tests/baselines/reference/findAllRefsEqualExportedObjectMember1.baseline.jsonc
new file mode 100644
index 0000000000000..7a1b895bfe5a4
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsEqualExportedObjectMember1.baseline.jsonc
@@ -0,0 +1,397 @@
+// === findAllReferences ===
+// === /mod.ts ===
+// const obj = {
+// /*FIND ALL REFS*/<|[|{| defId: 0, isWriteAccess: true, isDefinition: true |}foo|]: () => ""|>,
+// };
+//
+// export = obj;
+
+// === /index.ts ===
+// <|import { [|{| defId: 1, isWriteAccess: true |}foo|] } from "./mod"|>
+// [|{| defId: 1 |}foo|]();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // const obj = {
+ // /*FIND ALL REFS*/<|[|{| defId: 0 |}foo|]: () => ""|>,
+ // };
+ //
+ // export = obj;
+
+ // === /index.ts ===
+ // <|import { [|{| defId: 1 |}foo|] } from "./mod"|>
+ // foo();
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "property",
+ "name": "(property) foo: () => string",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "propertyName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (property) foo: () => string\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { /*FIND ALL REFS*/[|{| isWriteAccess: true, isDefinition: true |}foo|] } from "./mod"|>
+// [|foo|]();
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { /*FIND ALL REFS*/[|foo|] } from "./mod"|>
+ // foo();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (property) foo: () => string\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { [|{| isWriteAccess: true |}foo|] } from "./mod"|>
+// /*FIND ALL REFS*/[|foo|]();
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { [|foo|] } from "./mod"|>
+ // /*FIND ALL REFS*/foo();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (property) foo: () => string\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/baselines/reference/findAllRefsEqualExportedObjectMember2.baseline.jsonc b/tests/baselines/reference/findAllRefsEqualExportedObjectMember2.baseline.jsonc
new file mode 100644
index 0000000000000..8d7f2bfe7106e
--- /dev/null
+++ b/tests/baselines/reference/findAllRefsEqualExportedObjectMember2.baseline.jsonc
@@ -0,0 +1,401 @@
+// === findAllReferences ===
+// === /mod.ts ===
+// const obj = {
+// nested: {
+// /*FIND ALL REFS*/<|[|{| defId: 0, isWriteAccess: true, isDefinition: true |}foo|]: () => ""|>,
+// },
+// };
+//
+// export = obj.nested;
+
+// === /index.ts ===
+// <|import { [|{| defId: 1, isWriteAccess: true |}foo|] } from "./mod"|>
+// [|{| defId: 1 |}foo|]();
+
+ // === Definitions ===
+ // === /mod.ts ===
+ // const obj = {
+ // nested: {
+ // /*FIND ALL REFS*/<|[|{| defId: 0 |}foo|]: () => ""|>,
+ // },
+ // };
+ //
+ // export = obj.nested;
+
+ // === /index.ts ===
+ // <|import { [|{| defId: 1 |}foo|] } from "./mod"|>
+ // foo();
+
+ // === Details ===
+ [
+ {
+ "defId": 0,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "property",
+ "name": "(property) foo: () => string",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "propertyName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ }
+ ]
+ },
+ {
+ "defId": 1,
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (property) foo: () => string\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { /*FIND ALL REFS*/[|{| isWriteAccess: true, isDefinition: true |}foo|] } from "./mod"|>
+// [|foo|]();
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { /*FIND ALL REFS*/[|foo|] } from "./mod"|>
+ // foo();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (property) foo: () => string\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
+
+
+
+// === findAllReferences ===
+// === /index.ts ===
+// <|import { [|{| isWriteAccess: true |}foo|] } from "./mod"|>
+// /*FIND ALL REFS*/[|foo|]();
+
+ // === Definitions ===
+ // === /index.ts ===
+ // <|import { [|foo|] } from "./mod"|>
+ // /*FIND ALL REFS*/foo();
+
+ // === Details ===
+ [
+ {
+ "containerKind": "",
+ "containerName": "",
+ "kind": "alias",
+ "name": "(alias) (property) foo: () => string\nimport foo",
+ "displayParts": [
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "alias",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": "property",
+ "kind": "text"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "=>",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ },
+ {
+ "text": "\n",
+ "kind": "lineBreak"
+ },
+ {
+ "text": "import",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "aliasName"
+ }
+ ]
+ }
+ ]
\ No newline at end of file
diff --git a/tests/cases/fourslash/findAllRefsDefaultExportedClassInstanceMember1.ts b/tests/cases/fourslash/findAllRefsDefaultExportedClassInstanceMember1.ts
new file mode 100644
index 0000000000000..2c2ad8baca094
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsDefaultExportedClassInstanceMember1.ts
@@ -0,0 +1,16 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.ts
+//// class Cls {
+//// /*1*/foo() {}
+//// };
+////
+//// export default new Cls();
+
+// @Filename: /index.ts
+//// import def from "./mod"
+//// def.foo/*2*/();
+
+verify.baselineFindAllReferences("1", "2");
diff --git a/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember1.ts b/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember1.ts
new file mode 100644
index 0000000000000..87488c0923bfb
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember1.ts
@@ -0,0 +1,16 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.d.ts
+//// export default React;
+////
+//// declare namespace React {
+//// function /*1*/lazy(): void;
+//// }
+
+// @Filename: /index.ts
+//// import def from "./mod"
+//// def.lazy/*2*/();
+
+verify.baselineFindAllReferences("1", "2");
diff --git a/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember2.ts b/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember2.ts
new file mode 100644
index 0000000000000..d99ba4f962bf4
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember2.ts
@@ -0,0 +1,18 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.d.ts
+//// export default Outer.Inner;
+////
+//// declare namespace Outer {
+//// namespace Inner {
+//// function /*1*/lazy(): void;
+//// }
+//// }
+
+// @Filename: /index.ts
+//// import def from "./mod"
+//// def.lazy/*2*/();
+
+verify.baselineFindAllReferences("1", "2");
diff --git a/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember3.ts b/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember3.ts
new file mode 100644
index 0000000000000..8d17986575678
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsDefaultExportedNamespaceMember3.ts
@@ -0,0 +1,16 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.ts
+//// export default Ns;
+////
+//// namespace Ns {
+//// function /*1*/lazy() {} // this *isn't* exported from the namespace
+//// }
+
+// @Filename: /index.ts
+//// import def from "./mod"
+//// def.lazy/*2*/();
+
+verify.baselineFindAllReferences("1", "2");
diff --git a/tests/cases/fourslash/findAllRefsDefaultExportedObjectMember1.ts b/tests/cases/fourslash/findAllRefsDefaultExportedObjectMember1.ts
new file mode 100644
index 0000000000000..569943cc24330
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsDefaultExportedObjectMember1.ts
@@ -0,0 +1,16 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.ts
+//// const obj = {
+//// /*1*/foo: () => "",
+//// };
+////
+//// export default obj;
+
+// @Filename: /index.ts
+//// import def from "./mod"
+//// def.foo/*2*/();
+
+verify.baselineFindAllReferences("1", "2");
diff --git a/tests/cases/fourslash/findAllRefsDefaultExportedObjectMember2.ts b/tests/cases/fourslash/findAllRefsDefaultExportedObjectMember2.ts
new file mode 100644
index 0000000000000..fecdfcffd1887
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsDefaultExportedObjectMember2.ts
@@ -0,0 +1,18 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.ts
+//// const obj = {
+//// nested: {
+//// /*1*/foo: () => "",
+//// },
+//// };
+////
+//// export default obj.nested;
+
+// @Filename: /index.ts
+//// import def from "./mod"
+//// def.foo/*2*/();
+
+verify.baselineFindAllReferences("1", "2");
diff --git a/tests/cases/fourslash/findAllRefsEqualExportedClassInstanceMember1.ts b/tests/cases/fourslash/findAllRefsEqualExportedClassInstanceMember1.ts
new file mode 100644
index 0000000000000..45abc85db284b
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsEqualExportedClassInstanceMember1.ts
@@ -0,0 +1,16 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.ts
+//// class Cls {
+//// /*1*/foo() {}
+//// };
+////
+//// export = new Cls();
+
+// @Filename: /index.ts
+//// import { /*2*/foo } from "./mod"
+//// /*3*/foo();
+
+verify.baselineFindAllReferences("1", "2", "3");
diff --git a/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember1.ts b/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember1.ts
new file mode 100644
index 0000000000000..ac8a3a047ce96
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember1.ts
@@ -0,0 +1,16 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.d.ts
+//// export = React;
+////
+//// declare namespace React {
+//// function /*1*/lazy(): void;
+//// }
+
+// @Filename: /index.ts
+//// import { /*2*/lazy } from "./mod"
+//// /*3*/lazy();
+
+verify.baselineFindAllReferences("1", "2", "3");
diff --git a/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember2.ts b/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember2.ts
new file mode 100644
index 0000000000000..6831720be7b1b
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember2.ts
@@ -0,0 +1,18 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.d.ts
+//// export = Outer.Inner;
+////
+//// declare namespace Outer {
+//// namespace Inner {
+//// function /*1*/lazy(): void;
+//// }
+//// }
+
+// @Filename: /index.ts
+//// import { /*2*/lazy } from "./mod"
+//// /*3*/lazy();
+
+verify.baselineFindAllReferences("1", "2", "3");
diff --git a/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember3.ts b/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember3.ts
new file mode 100644
index 0000000000000..02747015e580d
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsEqualExportedNamespaceMember3.ts
@@ -0,0 +1,16 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.ts
+//// export = Ns;
+////
+//// namespace Ns {
+//// function /*1*/lazy() {} // this *isn't* exported from the namespace
+//// }
+
+// @Filename: /index.ts
+//// import { /*2*/lazy } from "./mod"
+//// /*3*/lazy();
+
+verify.baselineFindAllReferences("1", "2", "3");
diff --git a/tests/cases/fourslash/findAllRefsEqualExportedObjectMember1.ts b/tests/cases/fourslash/findAllRefsEqualExportedObjectMember1.ts
new file mode 100644
index 0000000000000..2ad849cab803d
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsEqualExportedObjectMember1.ts
@@ -0,0 +1,16 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.ts
+//// const obj = {
+//// /*1*/foo: () => "",
+//// };
+////
+//// export = obj;
+
+// @Filename: /index.ts
+//// import { /*2*/foo } from "./mod"
+//// /*3*/foo();
+
+verify.baselineFindAllReferences("1", "2", "3");
diff --git a/tests/cases/fourslash/findAllRefsEqualExportedObjectMember2.ts b/tests/cases/fourslash/findAllRefsEqualExportedObjectMember2.ts
new file mode 100644
index 0000000000000..c98b60f0ecfcd
--- /dev/null
+++ b/tests/cases/fourslash/findAllRefsEqualExportedObjectMember2.ts
@@ -0,0 +1,18 @@
+///
+
+// @module: commonjs
+
+// @Filename: /mod.ts
+//// const obj = {
+//// nested: {
+//// /*1*/foo: () => "",
+//// },
+//// };
+////
+//// export = obj.nested;
+
+// @Filename: /index.ts
+//// import { /*2*/foo } from "./mod"
+//// /*3*/foo();
+
+verify.baselineFindAllReferences("1", "2", "3");