Skip to content

Commit

Permalink
Temporarily default to enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Feb 3, 2022
1 parent e9dd907 commit cba8f31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,6 @@ namespace ts {
On,
}

/* @internal */
export function getAutoImportPreferences(preferences: UserPreferences) {
const includePackageJson =
preferences.includePackageJsonAutoImports === "off" ? PackageJsonAutoImportPreference.Off :
preferences.includePackageJsonAutoImports === "on" ? PackageJsonAutoImportPreference.On :
PackageJsonAutoImportPreference.Auto;
const includeProjectReferences =
preferences.includeProjectReferenceAutoImports === "on" ? ProjectReferenceAutoImportPreference.On :
ProjectReferenceAutoImportPreference.Off;
return { includePackageJson, includeProjectReferences };
}

export interface PerformanceEvent {
kind: "UpdateGraph" | "CreatePackageJsonAutoImportProvider";
durationMs: number;
Expand Down
13 changes: 13 additions & 0 deletions src/services/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3329,5 +3329,18 @@ namespace ts {
return memoizeOne((source: AutoImportSource) => getProgramForAutoImport(source, program, host));
}

export function getAutoImportPreferences(preferences: UserPreferences) {
const includePackageJson =
preferences.includePackageJsonAutoImports === "off" ? PackageJsonAutoImportPreference.Off :
preferences.includePackageJsonAutoImports === "on" ? PackageJsonAutoImportPreference.On :
PackageJsonAutoImportPreference.Auto;
// TODO: flip default back to "off" if shipping as an opt-in experiment.
// Needs to default to "on" until VS Code is able to set it.
const includeProjectReferences =
preferences.includeProjectReferenceAutoImports === "off" ? ProjectReferenceAutoImportPreference.Off :
ProjectReferenceAutoImportPreference.On;
return { includePackageJson, includeProjectReferences };
}

// #endregion
}

0 comments on commit cba8f31

Please sign in to comment.