From ceb189f7b0c32b867463964f4feecae52ad348f2 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 23 Oct 2024 21:44:43 +0100 Subject: [PATCH] feat: disable "enableProjectDiagnostics" on enable --- client/src/commands.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/client/src/commands.ts b/client/src/commands.ts index b0b49f10..aa58411e 100644 --- a/client/src/commands.ts +++ b/client/src/commands.ts @@ -655,6 +655,25 @@ export function enable( const config = vscode.workspace.getConfiguration(EXTENSION_NS); await config.update("enable", true); vscode.window.showInformationMessage("Deno workspace initialized."); + const tsserverConfig = vscode.workspace.getConfiguration( + "typescript.tsserver", + ); + if (tsserverConfig.get("experimental.enableProjectDiagnostics")) { + try { + await tsserverConfig.update( + "experimental.enableProjectDiagnostics", + false, + vscode.ConfigurationTarget.Workspace, + ); + vscode.window.showInformationMessage( + 'Disabled "typescript.tsserver.experimental.enableProjectDiagnostics" for the workspace. The Deno extension is incompatible with this setting. See: https://github.com/denoland/vscode_deno/issues/437#issuecomment-1720393193.', + ); + } catch { + vscode.window.showWarningMessage( + 'Setting "typescript.tsserver.experimental.enableProjectDiagnostics" is incompatible with the Deno extension. Either disable it in your user settings, or create a workspace and run the "Deno: Enable" command again. See: https://github.com/denoland/vscode_deno/issues/437#issuecomment-1720393193.', + ); + } + } }; }