From a8b60afc2ad8cd91aa00ae87147a4e0cb81b4183 Mon Sep 17 00:00:00 2001 From: Przemyslaw Horban Date: Tue, 22 Dec 2020 15:52:41 +0100 Subject: Extension conflict check detests more combinations --- editors/code/src/main.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'editors/code/src') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 4b2d3c8a5..601ed67a7 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -131,7 +131,7 @@ async function tryActivate(context: vscode.ExtensionContext) { ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config)); activateInlayHints(ctx); - warnAboutRustLangExtensionConflict(); + warnAboutExtensionConflicts(); vscode.workspace.onDidChangeConfiguration( _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }), @@ -411,11 +411,21 @@ async function queryForGithubToken(state: PersistentState): Promise { } } -function warnAboutRustLangExtensionConflict() { - const rustLangExt = vscode.extensions.getExtension("rust-lang.rust"); - if (rustLangExt !== undefined) { +function warnAboutExtensionConflicts() { + const conflicting = [ + ["rust-analyzer", "matklad.rust-analyzer"], + ["Rust", "rust-lang.rust"], + ["Rust", "kalitaalexey.vscode-rust"], + ]; + + const found = conflicting.filter( + nameId => vscode.extensions.getExtension(nameId[1]) !== undefined); + + if (found.length > 1) { + const fst = found[0]; + const sec = found[1]; vscode.window.showWarningMessage( - "You have both rust-analyzer (matklad.rust-analyzer) and Rust (rust-lang.rust) " + + `You have both ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` + "plugins enabled. These are known to conflict and cause various functions of " + "both plugins to not work correctly. You should disable one of them.", "Got it"); }; -- cgit v1.2.3 From 92b13d2fab0e816a905ceb4e7004628054d25922 Mon Sep 17 00:00:00 2001 From: "P. Horban" Date: Tue, 22 Dec 2020 16:22:33 +0100 Subject: Fix grammar nit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laurențiu Nicola --- editors/code/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors/code/src') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 601ed67a7..83d0bdf12 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -425,7 +425,7 @@ function warnAboutExtensionConflicts() { const fst = found[0]; const sec = found[1]; vscode.window.showWarningMessage( - `You have both ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` + + `You have both the ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` + "plugins enabled. These are known to conflict and cause various functions of " + "both plugins to not work correctly. You should disable one of them.", "Got it"); }; -- cgit v1.2.3