ts - refine log when canUseWatchEvents is not used

This commit is contained in:
Benjamin Pasero
2024-09-17 15:45:48 +02:00
committed by Benjamin Pasero
parent e36b6d7d54
commit 1fb9bc85a4

View File

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