Skip to content

Commit 5823b34

Browse files
authored
Revert "fix: remove TSC_NONPOLLING_WATCHER env variable" (#1316)
This reverts commit 17708d4. Fixes #1310 We need to do more investigation into the default watch options and setting them in the `ProjectService` host configuration.
1 parent f6e64dc commit 5823b34

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

client/src/client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ function constructArgs(ctx: vscode.ExtensionContext): string[] {
403403

404404
function getServerOptions(ctx: vscode.ExtensionContext, debug: boolean): lsp.NodeModule {
405405
// Environment variables for server process
406-
const prodEnv = {};
406+
const prodEnv = {
407+
// Force TypeScript to use the non-polling version of the file watchers.
408+
TSC_NONPOLLING_WATCHER: true,
409+
};
407410
const devEnv = {
408411
...prodEnv,
409412
NG_DEBUG: true,

integration/lsp/test_utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export function createConnection(serverOptions: ServerOptions): MessageConnectio
3030
}
3131
const server = fork(SERVER_PATH, argv, {
3232
cwd: PROJECT_PATH,
33+
env: {
34+
TSC_NONPOLLING_WATCHER: 'true',
35+
},
3336
// uncomment to debug server process
3437
// execArgv: ['--inspect-brk=9330']
3538
});

server/src/server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ function main() {
5959
session.info('Angular Language Service is running under DEBUG mode');
6060
}
6161

62+
if (process.env.TSC_NONPOLLING_WATCHER !== 'true') {
63+
session.warn(`Using less efficient polling watcher. Set TSC_NONPOLLING_WATCHER to true.`);
64+
}
65+
6266
session.listen();
6367
}
6468

0 commit comments

Comments
 (0)