Skip to content

Commit 06f1add

Browse files
authored
Revert "fix: remove TSC_NONPOLLING_WATCHER env variable" (#1317)
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 d008772 commit 06f1add

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

client/src/client.ts

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

359359
function getServerOptions(ctx: vscode.ExtensionContext, debug: boolean): lsp.NodeModule {
360360
// Environment variables for server process
361-
const prodEnv = {};
361+
const prodEnv = {
362+
// Force TypeScript to use the non-polling version of the file watchers.
363+
TSC_NONPOLLING_WATCHER: true,
364+
};
362365
const devEnv = {
363366
...prodEnv,
364367
NG_DEBUG: true,

integration/lsp/test_utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ export function createConnection(serverOptions: ServerOptions): MessageConnectio
3737
}
3838
const server = fork(SERVER_PATH, argv, {
3939
cwd: PROJECT_PATH,
40+
env: {
41+
TSC_NONPOLLING_WATCHER: 'true',
42+
},
4043
// uncomment to debug server process
4144
// execArgv: ['--inspect-brk=9330']
4245
});

server/src/server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,8 @@ if (logger.loggingEnabled()) {
5656
if (process.env.NG_DEBUG === 'true') {
5757
session.info('Angular Language Service is running under DEBUG mode');
5858
}
59+
if (process.env.TSC_NONPOLLING_WATCHER !== 'true') {
60+
session.warn(`Using less efficient polling watcher. Set TSC_NONPOLLING_WATCHER to true.`);
61+
}
5962

6063
session.listen();

0 commit comments

Comments
 (0)