Skip to content

Fix findAllReferences for export= namespace with ES6 imports#62412

Closed
mag123c wants to merge 5 commits intomicrosoft:mainfrom
mag123c:fix/find-all-references-export-equals
Closed

Fix findAllReferences for export= namespace with ES6 imports#62412
mag123c wants to merge 5 commits intomicrosoft:mainfrom
mag123c:fix/find-all-references-export-equals

Conversation

@mag123c
Copy link
Copy Markdown

@mag123c mag123c commented Sep 8, 2025

Fixes #62348

This fixes findAllReferences for the export = namespace + ES6 import pattern.

Problem

When using:

export = React;
declare namespace React { function lazy(): void; }
import { lazy } from "./mod";

Find All References doesn't work.

Solution

Added fallback symbol resolution in findAllReferences.ts for import specifiers when standard resolution fails.

Testing

Added test case findAllReferencesExportEqualsNamespace.ts. All existing tests pass

@mag123c
Copy link
Copy Markdown
Author

mag123c commented Sep 8, 2025

@microsoft-github-policy-service agree

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Sep 9, 2025
Replace direct exports Map access with TypeScript's official API for more robust export= namespace + ES6 import support.
@mag123c mag123c force-pushed the fix/find-all-references-export-equals branch from abd2e2f to eb1e93f Compare September 9, 2025 06:19
@mag123c mag123c force-pushed the fix/find-all-references-export-equals branch from eb1e93f to 9beaba2 Compare September 10, 2025 08:53
Copy link
Copy Markdown
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems too special-case-y to me. #62428 seems more plausible as a fix.

@mag123c mag123c closed this Sep 22, 2025
@microsoft microsoft locked as resolved and limited conversation to collaborators Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usage references can't be found for symbols exported through an exported namespace

3 participants