]> git.lizzy.rs Git - rust.git/blobdiff - editors/code/src/main.ts
Merge branch 'Veetaha-feat/sync-branch'
[rust.git] / editors / code / src / main.ts
index 670f2ebfd628f2f883a12943eccdfb68981b1236..cdb63b46f92f04b7d493b005783d6d14a14316de 100644 (file)
@@ -5,7 +5,6 @@ import { promises as fs, PathLike } from "fs";
 
 import * as commands from './commands';
 import { activateInlayHints } from './inlay_hints';
-import { activateStatusDisplay } from './status_display';
 import { Ctx } from './ctx';
 import { Config, NIGHTLY_TAG } from './config';
 import { log, assert, isValidExecutable } from './util';
@@ -43,12 +42,16 @@ export async function activate(context: vscode.ExtensionContext) {
     const config = new Config(context);
     const state = new PersistentState(context.globalState);
     const serverPath = await bootstrap(config, state).catch(err => {
-        let message = "Failed to bootstrap rust-analyzer.";
+        let message = "bootstrap error. ";
+
         if (err.code === "EBUSY" || err.code === "ETXTBSY") {
-            message += " Other vscode windows might be using rust-analyzer, " +
-                "you should close them and reload this window to retry.";
+            message += "Other vscode windows might be using rust-analyzer, ";
+            message += "you should close them and reload this window to retry. ";
         }
-        message += " Open \"Help > Toggle Developer Tools > Console\" to see the logs";
+
+        message += 'Open "Help > Toggle Developer Tools > Console" to see the logs ';
+        message += '(enable verbose logs with "rust-analyzer.trace.extension")';
+
         log.error("Bootstrap error", err);
         throw new Error(message);
     });
@@ -113,8 +116,6 @@ export async function activate(context: vscode.ExtensionContext) {
 
     ctx.pushCleanup(activateTaskProvider(workspaceFolder));
 
-    activateStatusDisplay(ctx);
-
     activateInlayHints(ctx);
 
     vscode.workspace.onDidChangeConfiguration(
@@ -178,7 +179,11 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
     assert(!!artifact, `Bad release: ${JSON.stringify(release)}`);
 
     const dest = path.join(config.globalStoragePath, "rust-analyzer.vsix");
-    await download(artifact.browser_download_url, dest, "Downloading rust-analyzer extension");
+    await download({
+        url: artifact.browser_download_url,
+        dest,
+        progressTitle: "Downloading rust-analyzer extension",
+    });
 
     await vscode.commands.executeCommand("workbench.extensions.installExtension", vscode.Uri.file(dest));
     await fs.unlink(dest);
@@ -299,7 +304,12 @@ async function getServer(config: Config, state: PersistentState): Promise<string
         if (err.code !== "ENOENT") throw err;
     });
 
-    await download(artifact.browser_download_url, dest, "Downloading rust-analyzer server", { mode: 0o755 });
+    await download({
+        url: artifact.browser_download_url,
+        dest,
+        progressTitle: "Downloading rust-analyzer server",
+        mode: 0o755
+    });
 
     // Patching executable if that's NixOS.
     if (await fs.stat("/etc/nixos").then(_ => true).catch(_ => false)) {