JsTyping: Remove "safeList" global variable (#17304)

This commit is contained in:
Andy
2017-07-27 10:54:47 -07:00
committed by GitHub
parent 977d907417
commit 3330f2a33b
5 changed files with 32 additions and 19 deletions

View File

@@ -85,6 +85,7 @@ namespace ts.server.typingsInstaller {
private readonly missingTypingsSet: Map<true> = createMap<true>();
private readonly knownCachesSet: Map<true> = createMap<true>();
private readonly projectWatchers: Map<FileWatcher[]> = createMap<FileWatcher[]>();
private safeList: JsTyping.SafeList | undefined;
readonly pendingRunRequests: PendingRequest[] = [];
private installRunCount = 1;
@@ -143,12 +144,15 @@ namespace ts.server.typingsInstaller {
this.processCacheLocation(req.cachePath);
}
if (this.safeList === undefined) {
this.safeList = JsTyping.loadSafeList(this.installTypingHost, this.safeListPath);
}
const discoverTypingsResult = JsTyping.discoverTypings(
this.installTypingHost,
this.log.isEnabled() ? this.log.writeLine : undefined,
req.fileNames,
req.projectRootPath,
this.safeListPath,
this.safeList,
this.packageNameToTypingLocation,
req.typeAcquisition,
req.unresolvedImports);