Skip to content

Commit 4b5435b

Browse files
committed
Make from-source install use cargo installed binary by default
1 parent 467a040 commit 4b5435b

File tree

6 files changed

+6
-21
lines changed

6 files changed

+6
-21
lines changed

docs/user/readme.adoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ $ cargo xtask install
9595
----
9696

9797
You'll need Cargo, nodejs and npm for this.
98-
To make VS Code use the freshly built server, add this to the settings:
99-
100-
[source,json]
101-
----
102-
{ "rust-analyzer.serverPath": "rust-analyzer" }
103-
----
10498

10599
Note that installing via `xtask install` does not work for VS Code Remote, instead you'll need to install the `.vsix` manually.
106100

editors/code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"private": true,
77
"icon": "icon.png",
88
"version": "0.4.0-dev",
9-
"releaseTag": "nightly",
9+
"releaseTag": null,
1010
"publisher": "matklad",
1111
"repository": {
1212
"url": "https://github.com/rust-analyzer/rust-analyzer.git",

editors/code/src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ export class Config {
4444
.packageJSON
4545
.version;
4646

47-
readonly releaseTag: string = vscode
47+
readonly releaseTag: string | undefined = vscode
4848
.extensions
4949
.getExtension(this.extensionId)!
5050
.packageJSON
51-
.releaseTag;
51+
.releaseTag ?? undefined;
5252

5353
private cfg!: vscode.WorkspaceConfiguration;
5454

editors/code/src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ async function bootstrap(config: Config, state: PersistentState): Promise<string
110110
}
111111

112112
async function bootstrapExtension(config: Config, state: PersistentState): Promise<void> {
113+
if (config.releaseTag === undefined) return;
113114
if (config.channel === "stable") {
114115
if (config.releaseTag === NIGHTLY_TAG) {
115116
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<string
184185
}
185186
return explicitPath;
186187
};
188+
if (config.releaseTag === undefined) return "rust-analyzer";
187189

188190
let binaryName: string | undefined = undefined;
189191
if (process.arch === "x64" || process.arch === "x32") {

xtask/src/dist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn dist_client(version: &str, release_tag: &str) -> Result<()> {
2727

2828
patch
2929
.replace(r#""version": "0.4.0-dev""#, &format!(r#""version": "{}""#, version))
30-
.replace(r#""releaseTag": "nightly""#, &format!(r#""releaseTag": "{}""#, release_tag));
30+
.replace(r#""releaseTag": null"#, &format!(r#""releaseTag": "{}""#, release_tag));
3131

3232
if nightly {
3333
patch.replace(

xtask/src/install.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub struct ServerOpt {
2424

2525
impl InstallCmd {
2626
pub fn run(self) -> Result<()> {
27-
let both = self.server.is_some() && self.client.is_some();
2827
if cfg!(target_os = "macos") {
2928
fix_path_for_mac().context("Fix path for mac")?
3029
}
@@ -34,16 +33,6 @@ impl InstallCmd {
3433
if let Some(client) = self.client {
3534
install_client(client).context("install client")?;
3635
}
37-
if both {
38-
eprintln!(
39-
"
40-
Installation complete.
41-
42-
Add `\"rust-analyzer.serverPath\": \"rust-analyzer\",` to VS Code settings,
43-
otherwise it will use the latest release from GitHub.
44-
"
45-
)
46-
}
4736
Ok(())
4837
}
4938
}

0 commit comments

Comments
 (0)