From dc2b00c716be88581f677b81b7720f85439d3f31 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Thu, 8 Dec 2022 11:44:13 +0100 Subject: [PATCH] (fix) set watchFile polling interval (#1764) marked as optional, but seems to be required in TS 4.9 --- .../language-server/src/plugins/typescript/service.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/language-server/src/plugins/typescript/service.ts b/packages/language-server/src/plugins/typescript/service.ts index 30b0a01c0..ab75f4e2f 100644 --- a/packages/language-server/src/plugins/typescript/service.ts +++ b/packages/language-server/src/plugins/typescript/service.ts @@ -555,7 +555,11 @@ async function createLanguageService( } if (!configWatchers.has(tsconfigPath) && tsconfigPath) { - configWatchers.set(tsconfigPath, tsSystem.watchFile(tsconfigPath, watchConfigCallback)); + configWatchers.set( + tsconfigPath, + // for some reason setting the polling interval is necessary, else some error in TS is thrown + tsSystem.watchFile(tsconfigPath, watchConfigCallback, 1000) + ); } for (const config of extendedConfigPaths) { @@ -565,7 +569,8 @@ async function createLanguageService( extendedConfigWatchers.set( config, - tsSystem.watchFile(config, createWatchExtendedConfigCallback(docContext)) + // for some reason setting the polling interval is necessary, else some error in TS is thrown + tsSystem.watchFile(config, createWatchExtendedConfigCallback(docContext), 1000) ); } }