Search Terms
Suggestion
In tsserver, the completionInfo request benefits from a cache of import suggestions.
|
function getSymbolsFromOtherSourceFileExports(target: ScriptTarget, host: LanguageServiceHost): readonly AutoImportSuggestion[] { |
|
const cached = importSuggestionsCache && importSuggestionsCache.get( |
|
sourceFile.fileName, |
|
typeChecker, |
|
detailsEntryId && host.getProjectVersion ? host.getProjectVersion() : undefined); |
Could the getCodeFixes request be extended to use a suggestion imports cache as well?
|
forEachExternalModuleToImportFrom(program, host, importingFile, /*filterByPackageJson*/ false, useAutoImportProvider, (moduleSymbol, moduleFile, program) => { |
Both call codeFixes.forEachExternalModuleToImportFrom, which can be very slow in a large project. Thanks!
Checklist
My suggestion meets these guidelines:
Search Terms
Suggestion
In tsserver, the
completionInforequest benefits from a cache of import suggestions.TypeScript/src/services/completions.ts
Lines 1627 to 1631 in d156bb8
Could the
getCodeFixesrequest be extended to use a suggestion imports cache as well?TypeScript/src/services/codefixes/importFixes.ts
Line 234 in 2428ade
Both call
codeFixes.forEachExternalModuleToImportFrom, which can be very slow in a large project. Thanks!Checklist
My suggestion meets these guidelines: