mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 11:46:08 -05:00
Handle resolution watching when its dynamic scriptInfo (#62894)
This commit is contained in:
@@ -1530,6 +1530,15 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
|
||||
|
||||
/** @internal */
|
||||
watchTypingLocations(files: readonly string[] | undefined): void {
|
||||
// Skip watching typing locations for inferred project whose currentDirectory is not watchable or
|
||||
// is same as server's current directory
|
||||
if (
|
||||
this.currentDirectory === this.projectService.currentDirectory ||
|
||||
!canWatchDirectoryOrFilePath(this.toPath(this.currentDirectory))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!files) {
|
||||
this.typingWatchers!.isInvoked = false;
|
||||
return;
|
||||
@@ -1626,6 +1635,18 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
|
||||
});
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
skipWatchingFailedLookups(path: Path): boolean | undefined {
|
||||
const info = this.projectService.getScriptInfoForPath(path);
|
||||
return info?.isDynamic;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
skipWatchingTypeRoots(): boolean | undefined {
|
||||
// Skip watching inferrd project where current directory is lib location
|
||||
return isInferredProject(this) && this.currentDirectory === this.projectService.currentDirectory;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
getCurrentProgram(): Program | undefined {
|
||||
return this.program;
|
||||
|
||||
Reference in New Issue
Block a user