Skip to content

Don’t try to recreate AutoImportProvider after giving up because of too many dependencies until program structure changes#59692

Merged
andrewbranch merged 9 commits into
microsoft:mainfrom
andrewbranch:bug/auto-import-provider-duplicate-creation-attempts
Aug 21, 2024
Merged

Don’t try to recreate AutoImportProvider after giving up because of too many dependencies until program structure changes#59692
andrewbranch merged 9 commits into
microsoft:mainfrom
andrewbranch:bug/auto-import-provider-duplicate-creation-attempts

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

I noticed the following sequence in a TS Server log:

Info 1254 [11:44:16.297] getCompletionsAtPosition: isCompletionListBlocker: 0.037459000002854737
Info 1255 [11:44:16.328] AutoImportProviderProject: attempted to add more than 10 dependencies. Aborting.
Info 1256 [11:44:16.328] getExportInfoMap: cache miss or empty; calculating new results
Info 1257 [11:44:16.399] AutoImportProviderProject: attempted to add more than 10 dependencies. Aborting.
Info 1258 [11:44:16.399] getExportInfoMap: done in 97.71966699999757 ms
Info 1259 [11:44:16.403] AutoImportProviderProject: attempted to add more than 10 dependencies. Aborting.

host.getPackageJsonAutoImportProvider() gets called multiple times during completions. When an AutoImportProvider program exists, it’s cached and updated appropriately. But when one fails to be created because either it finds no dependencies or too many dependencies, the result of that failure wasn’t being stored; instead, we tried to recreate it every time we attempt to get it from the host.

View commit d44feec in isolation to see the desired effect in the server logs.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 19, 2024
Comment thread src/server/project.ts Outdated
@andrewbranch andrewbranch merged commit 7f597be into microsoft:main Aug 21, 2024
@andrewbranch andrewbranch deleted the bug/auto-import-provider-duplicate-creation-attempts branch August 21, 2024 00:12
@sandersn sandersn removed this from PR Backlog Apr 22, 2025
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants