From 1fb9bc85a4631871bf2ba28be67b3eb0779da758 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 17 Sep 2024 15:45:48 +0200 Subject: [PATCH] ts - refine log when `canUseWatchEvents` is not used --- .../src/tsServer/spawner.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/extensions/typescript-language-features/src/tsServer/spawner.ts b/extensions/typescript-language-features/src/tsServer/spawner.ts index 304a55501ea..aac3186631e 100644 --- a/extensions/typescript-language-features/src/tsServer/spawner.ts +++ b/extensions/typescript-language-features/src/tsServer/spawner.ts @@ -268,14 +268,20 @@ export class TypeScriptServerSpawner { args.push('--noGetErrOnBackgroundUpdate'); + const configUseVsCodeWatcher = configuration.useVsCodeWatcher; + const isYarnPnp = apiVersion.isYarnPnp(); if ( apiVersion.gte(API.v544) - && configuration.useVsCodeWatcher - && !apiVersion.isYarnPnp() // Disable for yarn pnp as it currently breaks with the VS Code watcher + && configUseVsCodeWatcher + && !isYarnPnp // Disable for yarn pnp as it currently breaks with the VS Code watcher ) { args.push('--canUseWatchEvents'); } else { - this._logger.info(`<${kind}> Falling back to legacy node.js based file watching...`); + if (!configUseVsCodeWatcher) { + this._logger.info(`<${kind}> Falling back to legacy node.js based file watching because of user settings.`); + } else if (isYarnPnp) { + this._logger.info(`<${kind}> Falling back to legacy node.js based file watching because of Yarn PnP.`); + } } args.push('--validateDefaultNpmLocation');