aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
authorPrzemyslaw Horban <[email protected]>2020-12-22 14:52:41 +0000
committerPrzemyslaw Horban <[email protected]>2020-12-22 14:53:00 +0000
commita8b60afc2ad8cd91aa00ae87147a4e0cb81b4183 (patch)
treecde9f944399881fa313507cb787ae90bb431ad4c /editors/code/src
parente1acb0ca5ca2162be068fd6a07f7cc4ae171ed81 (diff)
Extension conflict check detests more combinations
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/main.ts20
1 files changed, 15 insertions, 5 deletions
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) {
131 ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config)); 131 ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config));
132 132
133 activateInlayHints(ctx); 133 activateInlayHints(ctx);
134 warnAboutRustLangExtensionConflict(); 134 warnAboutExtensionConflicts();
135 135
136 vscode.workspace.onDidChangeConfiguration( 136 vscode.workspace.onDidChangeConfiguration(
137 _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }), 137 _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
@@ -411,11 +411,21 @@ async function queryForGithubToken(state: PersistentState): Promise<void> {
411 } 411 }
412} 412}
413 413
414function warnAboutRustLangExtensionConflict() { 414function warnAboutExtensionConflicts() {
415 const rustLangExt = vscode.extensions.getExtension("rust-lang.rust"); 415 const conflicting = [
416 if (rustLangExt !== undefined) { 416 ["rust-analyzer", "matklad.rust-analyzer"],
417 ["Rust", "rust-lang.rust"],
418 ["Rust", "kalitaalexey.vscode-rust"],
419 ];
420
421 const found = conflicting.filter(
422 nameId => vscode.extensions.getExtension(nameId[1]) !== undefined);
423
424 if (found.length > 1) {
425 const fst = found[0];
426 const sec = found[1];
417 vscode.window.showWarningMessage( 427 vscode.window.showWarningMessage(
418 "You have both rust-analyzer (matklad.rust-analyzer) and Rust (rust-lang.rust) " + 428 `You have both ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` +
419 "plugins enabled. These are known to conflict and cause various functions of " + 429 "plugins enabled. These are known to conflict and cause various functions of " +
420 "both plugins to not work correctly. You should disable one of them.", "Got it"); 430 "both plugins to not work correctly. You should disable one of them.", "Got it");
421 }; 431 };