From 4b5435b52bdcb54eea18c80f952cfc3a72975e70 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 20 Mar 2020 12:50:50 +0100 Subject: Make from-source install use cargo installed binary by default --- docs/user/readme.adoc | 6 ------ editors/code/package.json | 2 +- editors/code/src/config.ts | 4 ++-- editors/code/src/main.ts | 2 ++ xtask/src/dist.rs | 2 +- xtask/src/install.rs | 11 ----------- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc index 18e2fac9e..0dfc12b52 100644 --- a/docs/user/readme.adoc +++ b/docs/user/readme.adoc @@ -95,12 +95,6 @@ $ cargo xtask install ---- You'll need Cargo, nodejs and npm for this. -To make VS Code use the freshly built server, add this to the settings: - -[source,json] ----- -{ "rust-analyzer.serverPath": "rust-analyzer" } ----- Note that installing via `xtask install` does not work for VS Code Remote, instead you'll need to install the `.vsix` manually. diff --git a/editors/code/package.json b/editors/code/package.json index 2cb48abb7..7f1aa2273 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -6,7 +6,7 @@ "private": true, "icon": "icon.png", "version": "0.4.0-dev", - "releaseTag": "nightly", + "releaseTag": null, "publisher": "matklad", "repository": { "url": "https://github.com/rust-analyzer/rust-analyzer.git", diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 54b905303..be5296fcf 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -44,11 +44,11 @@ export class Config { .packageJSON .version; - readonly releaseTag: string = vscode + readonly releaseTag: string | undefined = vscode .extensions .getExtension(this.extensionId)! .packageJSON - .releaseTag; + .releaseTag ?? undefined; private cfg!: vscode.WorkspaceConfiguration; diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 5297614a9..5d2da9a76 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -110,6 +110,7 @@ async function bootstrap(config: Config, state: PersistentState): Promise { + if (config.releaseTag === undefined) return; if (config.channel === "stable") { if (config.releaseTag === NIGHTLY_TAG) { vscode.window.showWarningMessage(`You are running a nightly version of rust-analyzer extension. @@ -184,6 +185,7 @@ async function getServer(config: Config, state: PersistentState): Promise Result<()> { patch .replace(r#""version": "0.4.0-dev""#, &format!(r#""version": "{}""#, version)) - .replace(r#""releaseTag": "nightly""#, &format!(r#""releaseTag": "{}""#, release_tag)); + .replace(r#""releaseTag": null"#, &format!(r#""releaseTag": "{}""#, release_tag)); if nightly { patch.replace( diff --git a/xtask/src/install.rs b/xtask/src/install.rs index d0d745b05..bc32a04b3 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs @@ -24,7 +24,6 @@ pub struct ServerOpt { impl InstallCmd { pub fn run(self) -> Result<()> { - let both = self.server.is_some() && self.client.is_some(); if cfg!(target_os = "macos") { fix_path_for_mac().context("Fix path for mac")? } @@ -34,16 +33,6 @@ impl InstallCmd { if let Some(client) = self.client { install_client(client).context("install client")?; } - if both { - eprintln!( - " - Installation complete. - - Add `\"rust-analyzer.serverPath\": \"rust-analyzer\",` to VS Code settings, - otherwise it will use the latest release from GitHub. -" - ) - } Ok(()) } } -- cgit v1.2.3