Skip to content

Use correct program when checking for reexports from AutoImportProviderProject #40843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

andrewbranch
Copy link
Member

Fixes #40223

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Sep 29, 2020
Comment on lines +534 to +535
forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, (moduleSymbol, _, program) => {
const checker = program.getTypeChecker();
Copy link
Member Author

Choose a reason for hiding this comment

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

When there’s an AutoImportProviderProject, these modules can come from different programs, but this was always asking for exports of module symbols with the same checker instance, which would be missing resolved exports cached on symbol links if the module was checked by a different checker. That’s why a program is passed to this callback, but I missed this usage of it in the original refactor.

@andrewbranch andrewbranch merged commit a301001 into microsoft:master Sep 30, 2020
@andrewbranch andrewbranch deleted the bug/40223 branch September 30, 2020 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript prefers deep paths for import quick fixes (and auto-imports?)
3 participants