mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Do not watch tsconfig files from folders that we canot watch
Fixes #30818
This commit is contained in:
@@ -1333,7 +1333,11 @@ namespace ts.server {
|
||||
|
||||
const watches: WatchType[] = [];
|
||||
if (configFileExistenceInfo.configFileWatcherForRootOfInferredProject) {
|
||||
watches.push(WatchType.ConfigFileForInferredRoot);
|
||||
watches.push(
|
||||
configFileExistenceInfo.configFileWatcherForRootOfInferredProject === noopFileWatcher ?
|
||||
WatchType.NoopConfigFileForInferredRoot :
|
||||
WatchType.ConfigFileForInferredRoot
|
||||
);
|
||||
}
|
||||
if (this.configuredProjects.has(canonicalConfigFilePath)) {
|
||||
watches.push(WatchType.ConfigFile);
|
||||
@@ -1349,13 +1353,16 @@ namespace ts.server {
|
||||
canonicalConfigFilePath: string,
|
||||
configFileExistenceInfo: ConfigFileExistenceInfo
|
||||
) {
|
||||
configFileExistenceInfo.configFileWatcherForRootOfInferredProject = this.watchFactory.watchFile(
|
||||
this.host,
|
||||
configFileName,
|
||||
(_filename, eventKind) => this.onConfigFileChangeForOpenScriptInfo(configFileName, eventKind),
|
||||
PollingInterval.High,
|
||||
WatchType.ConfigFileForInferredRoot
|
||||
);
|
||||
configFileExistenceInfo.configFileWatcherForRootOfInferredProject =
|
||||
canWatchDirectory(getDirectoryPath(canonicalConfigFilePath) as Path) ?
|
||||
this.watchFactory.watchFile(
|
||||
this.host,
|
||||
configFileName,
|
||||
(_filename, eventKind) => this.onConfigFileChangeForOpenScriptInfo(configFileName, eventKind),
|
||||
PollingInterval.High,
|
||||
WatchType.ConfigFileForInferredRoot
|
||||
) :
|
||||
noopFileWatcher;
|
||||
this.logConfigFileWatchUpdate(configFileName, canonicalConfigFilePath, configFileExistenceInfo, ConfigFileWatcherStatus.UpdatedCallback);
|
||||
}
|
||||
|
||||
|
||||
@@ -226,5 +226,6 @@ namespace ts {
|
||||
ConfigFileForInferredRoot = "Config file for the inferred project root",
|
||||
NodeModulesForClosedScriptInfo = "node_modules for closed script infos in them",
|
||||
MissingSourceMapFile = "Missing source map file",
|
||||
NoopConfigFileForInferredRoot = "Noop Config file for the inferred project root",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user