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');