Skip to content

Commit 0f86c04

Browse files
authored
Fixes searches for symbols exported using export * as (#39507)
Fixes #39006
1 parent ebac7ec commit 0f86c04

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/services/importTracker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ namespace ts.FindAllReferences {
122122
// This is `export * from "foo"`, so imports of this module may import the export too.
123123
handleDirectImports(getContainingModuleSymbol(direct, checker));
124124
}
125+
else if (direct.exportClause.kind === SyntaxKind.NamespaceExport) {
126+
// `export * as foo from "foo"` add to indirect uses
127+
addIndirectUsers(getSourceFileLikeForImportDeclaration(direct));
128+
}
125129
else {
126130
// This is `export { foo } from "foo"` and creates an alias symbol, so recursive search will get handle re-exports.
127131
directImports.push(direct);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: /leafModule.ts
4+
////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}hello|] = () => 'Hello';|]
5+
6+
// @Filename: /exporting.ts
7+
////export * as Leaf from './leafModule';
8+
9+
// @Filename: /importing.ts
10+
//// import { Leaf } from './exporting';
11+
//// Leaf.[|hello|]()
12+
13+
verify.noErrors();
14+
const ranges = test.ranges();
15+
const [r0Def, r0, r1] = ranges;
16+
verify.singleReferenceGroup("const hello: () => string", [r0, r1]);

0 commit comments

Comments
 (0)