Skip to content

Commit

Permalink
Undo potentially compatibility-destroying changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMarkUSDS committed Jan 21, 2024
1 parent a9abcb4 commit 4bac889
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ let pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
export let unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);

function setCustomPollingValues(system: System) {
if (system.getEnvironmentVariable === undefined) {
return;
}
const pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval);
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || unchangedPollThresholds;
Expand Down
1 change: 1 addition & 0 deletions src/services/stringCompletions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ function getCompletionEntriesFromTypings(host: LanguageServiceHost, options: Com
}

function enumerateNodeModulesVisibleToScript(host: LanguageServiceHost, scriptPath: string): readonly string[] {
if (host.readFile === undefined || host.fileExists === undefined) return emptyArray;
const result: string[] = [];
for (const packageJson of findPackageJsons(scriptPath, host)) {
const contents = readJson(packageJson, host as { readFile: (filename: string) => string | undefined; }); // Cast to assert that readFile is defined
Expand Down
3 changes: 3 additions & 0 deletions src/services/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3670,6 +3670,9 @@ export function findPackageJson(directory: string, host: LanguageServiceHost): s

/** @internal */
export function getPackageJsonsVisibleToFile(fileName: string, host: LanguageServiceHost): readonly ProjectPackageJsonInfo[] {
if (host.fileExists === undefined) {
return [];
}
const packageJsons: ProjectPackageJsonInfo[] = [];
forEachAncestorDirectory(getDirectoryPath(fileName), ancestor => {
const packageJsonFileName = combinePaths(ancestor, "package.json");
Expand Down

0 comments on commit 4bac889

Please sign in to comment.