Skip to content

Commit

Permalink
(fix) set watchFile polling interval (#1764)
Browse files Browse the repository at this point in the history
marked as optional, but seems to be required in TS 4.9
  • Loading branch information
dummdidumm authored Dec 8, 2022
1 parent 37d73e9 commit dc2b00c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/language-server/src/plugins/typescript/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
);
}
}
Expand Down

0 comments on commit dc2b00c

Please sign in to comment.