From 62ef6b1cda057823d935147493a6fc48ac0f8f76 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 17 Jul 2017 12:37:36 -0700 Subject: [PATCH] Added another todo as now we are watching too many files --- src/server/editorServices.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index c2b712c06a2..8c9731ef6ea 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -849,6 +849,13 @@ namespace ts.server { private configFileExists(configFileName: NormalizedPath, info: ScriptInfo) { const canonicalConfigFilePath = normalizedPathToPath(configFileName, this.currentDirectory, this.toCanonicalFileName); + // TODO: (sheetalkamat) Need to reduce the number of watches by not watching directories right here. + // Theorotically current approach is correct but in practice there will be very few scenarios where + // the config file gets added somewhere inside the another config file. And technically we could handle that case in configDirectory watcher in some cases + // But given that its a rare scenario it seems like too much overhead. + // So what we want to be watching is: configFile if the project is open + // And the whole chain only for the inferred project roots + // instead create the cache and send it across, and put watches only if info gets added to the inferred project root? return this.watchConfigFileForScriptInfo(configFileName, canonicalConfigFilePath, info).exists; }