]> git.lizzy.rs Git - rust.git/commitdiff
Added a warning if conflicting rust-lang.rust is enabled.
authorPrzemyslaw Horban <p.horban@invinets.com>
Fri, 18 Dec 2020 17:39:51 +0000 (18:39 +0100)
committerPrzemyslaw Horban <p.horban@invinets.com>
Fri, 18 Dec 2020 17:39:51 +0000 (18:39 +0100)
editors/code/src/main.ts

index 2f3dde8acd6dedc51fc58a6560cfdae304156783..1c88b46135eaeef410549ba699a7d93c92912052 100644 (file)
@@ -132,6 +132,7 @@ async function tryActivate(context: vscode.ExtensionContext) {
     ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config));
 
     activateInlayHints(ctx);
+    warnAboutRustLangExtensionConflict();
 
     vscode.workspace.onDidChangeConfiguration(
         _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
@@ -399,3 +400,13 @@ async function queryForGithubToken(state: PersistentState): Promise<void> {
         await state.updateGithubToken(newToken);
     }
 }
+
+function warnAboutRustLangExtensionConflict() {
+    const rustLangExt = vscode.extensions.getExtension("rust-lang.rust");
+    if (rustLangExt !== undefined) {
+        vscode.window .showWarningMessage(
+            "You have both rust-analyzer (matklad.rust-analyzer) and Rust (rust-lang.rust) " +
+            "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")
+    };
+}