diff options
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 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 | ||
414 | function warnAboutRustLangExtensionConflict() { | 414 | function 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 | }; |