mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
Fixes searches for symbols exported using export * as (#39507)
Fixes #39006
This commit is contained in:
@@ -122,6 +122,10 @@ namespace ts.FindAllReferences {
|
||||
// This is `export * from "foo"`, so imports of this module may import the export too.
|
||||
handleDirectImports(getContainingModuleSymbol(direct, checker));
|
||||
}
|
||||
else if (direct.exportClause.kind === SyntaxKind.NamespaceExport) {
|
||||
// `export * as foo from "foo"` add to indirect uses
|
||||
addIndirectUsers(getSourceFileLikeForImportDeclaration(direct));
|
||||
}
|
||||
else {
|
||||
// This is `export { foo } from "foo"` and creates an alias symbol, so recursive search will get handle re-exports.
|
||||
directImports.push(direct);
|
||||
|
||||
16
tests/cases/fourslash/findAllRefsReExportStarAs.ts
Normal file
16
tests/cases/fourslash/findAllRefsReExportStarAs.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /leafModule.ts
|
||||
////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}hello|] = () => 'Hello';|]
|
||||
|
||||
// @Filename: /exporting.ts
|
||||
////export * as Leaf from './leafModule';
|
||||
|
||||
// @Filename: /importing.ts
|
||||
//// import { Leaf } from './exporting';
|
||||
//// Leaf.[|hello|]()
|
||||
|
||||
verify.noErrors();
|
||||
const ranges = test.ranges();
|
||||
const [r0Def, r0, r1] = ranges;
|
||||
verify.singleReferenceGroup("const hello: () => string", [r0, r1]);
|
||||
Reference in New Issue
Block a user