Skip to content

Commit 0576622

Browse files
authored
Remove unnecessary properties of TypingsCacheEntry (#59044)
1 parent 3b4cfb5 commit 0576622

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/server/project.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,7 @@ type TypingWatchers = Map<Path, FileWatcher> & { isInvoked?: boolean; };
310310
interface TypingsCacheEntry {
311311
readonly typeAcquisition: TypeAcquisition;
312312
readonly compilerOptions: CompilerOptions;
313-
readonly typings: SortedReadonlyArray<string>;
314313
readonly unresolvedImports: SortedReadonlyArray<string> | undefined;
315-
/* mainly useful for debugging */
316-
poisoned: boolean;
317314
}
318315

319316
function setIsEqualTo(arr1: string[] | undefined, arr2: string[] | undefined): boolean {
@@ -1477,9 +1474,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
14771474
this.typingsCache = {
14781475
compilerOptions: this.getCompilationSettings(),
14791476
typeAcquisition,
1480-
typings: entry ? entry.typings : emptyArray,
14811477
unresolvedImports: this.lastCachedUnresolvedImportsList,
1482-
poisoned: true,
14831478
};
14841479
// something has been changed, issue a request to update typings
14851480
this.projectService.typingsInstaller.enqueueInstallTypingsRequest(this, typeAcquisition, this.lastCachedUnresolvedImportsList);
@@ -1488,15 +1483,12 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
14881483

14891484
/** @internal */
14901485
updateTypingFiles(compilerOptions: CompilerOptions, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, newTypings: string[]) {
1491-
const typings = sort(newTypings);
14921486
this.typingsCache = {
14931487
compilerOptions,
14941488
typeAcquisition,
1495-
typings,
14961489
unresolvedImports,
1497-
poisoned: false,
14981490
};
1499-
const typingFiles = !typeAcquisition || !typeAcquisition.enable ? emptyArray : typings;
1491+
const typingFiles = !typeAcquisition || !typeAcquisition.enable ? emptyArray : sort(newTypings);
15001492
if (enumerateInsertsAndDeletes<string, string>(typingFiles, this.typingFiles, getStringComparer(!this.useCaseSensitiveFileNames()), /*inserted*/ noop, removed => this.detachScriptInfoFromProject(removed))) {
15011493
// If typing files changed, then only schedule project update
15021494
this.typingFiles = typingFiles;

0 commit comments

Comments
 (0)