Handle package.json watch in tsc and tsserver. (#49328)

* refactoring

* Maintain packagejson paths per resolution so we dont have invalidate everything on package json change

* Fix todo
This commit is contained in:
Sheetal Nandi
2022-06-08 10:22:29 -07:00
committed by GitHub
parent b8f6488323
commit 5cedf3e680
85 changed files with 1974 additions and 550 deletions

View File

@@ -522,6 +522,18 @@ namespace ts.server {
);
}
/*@internal*/
watchAffectingFileLocation(file: string, cb: FileWatcherCallback) {
return this.projectService.watchFactory.watchFile(
file,
cb,
PollingInterval.High,
this.projectService.getWatchOptions(this),
WatchType.PackageJson,
this
);
}
/*@internal*/
clearInvalidateResolutionOfFailedLookupTimer() {
return this.projectService.throttledOperations.cancel(`${this.getProjectName()}FailedLookupInvalidation`);