diff options
| author | Przemyslaw Horban <p.horban@invinets.com> | 2020-12-22 15:52:41 +0100 |
|---|---|---|
| committer | Przemyslaw Horban <p.horban@invinets.com> | 2020-12-22 15:53:00 +0100 |
| commit | a8b60afc2ad8cd91aa00ae87147a4e0cb81b4183 (patch) | |
| tree | cde9f944399881fa313507cb787ae90bb431ad4c /editors/code/src | |
| parent | e1acb0ca5ca2162be068fd6a07f7cc4ae171ed81 (diff) | |
| download | rust-a8b60afc2ad8cd91aa00ae87147a4e0cb81b4183.tar.gz rust-a8b60afc2ad8cd91aa00ae87147a4e0cb81b4183.zip | |
Extension conflict check detests more combinations
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/main.ts | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 4b2d3c8a557..601ed67a7d9 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<void> { } } -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"); }; |
