8000 Include actual generated module specifiers in module specifier cache by andrewbranch · Pull Request #44176 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content

Include actual generated module specifiers in module specifier cache #44176

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 14 commits into from
Jun 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into perf/module-specifier-cache
  • Loading branch information
andrewbranch committed Jun 8, 2021
commit d4f2633cdb6ae911d20c925c8282b1d03ad8840e
7 changes: 6 additions & 1 deletion src/services/codefixes/importFixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ namespace ts.codefix {
program: Program,
host: LanguageServiceHost,
preferences: UserPreferences
): { exportInfo?: SymbolExportInfo, moduleSpecifier: string } {
): { exportInfo?: SymbolExportInfo, moduleSpecifier: string } | undefined {
return getBestFix(getNewImportFixes(program, importingFile, /*position*/ undefined, /*preferTypeOnlyImport*/ false, /*useRequire*/ false, exportInfo, host, preferences), importingFile, host, preferences);
}

Expand Down Expand Up @@ -531,7 +531,12 @@ namespace ts.codefix {
return sort(fixes, (a, b) => compareValues(a.kind, b.kind) || compareModuleSpecifiers(a, b, allowsImportingSpecifier));
}

<<<<<<< HEAD
function getBestFix<T extends ImportFix>(fixes: readonly T[], sourceFile: SourceFile, host: LanguageServiceHost, preferences: UserPreferences): T {
=======
function getBestFix<T extends ImportFix>(fixes: readonly T[], sourceFile: SourceFile, host: LanguageServiceHost): T | undefined {
if (!some(fixes)) return;
>>>>>>> main
// These will always be placed first if available, and are better than other kinds
if (fixes[0].kind === ImportFixKind.UseNamespace || fixes[0].kind === ImportFixKind.AddToExisting) {
return fixes[0];
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0