Skip to content

Commit bd7aa5d

Browse files
committed
Rename VS Code extension to rust-analyzer
1 parent a05970d commit bd7aa5d

File tree

6 files changed

+34
-17
lines changed

6 files changed

+34
-17
lines changed

docs/user/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $ cargo xtask install
4444
The automatic installation is expected to *just work* for common cases, if it
4545
doesn't, report bugs!
4646

47-
**Note** [#1831](https://github.com/rust-analyzer/rust-analyzer/issues/1831): If you are using the popular
47+
**Note** [#1831](https://github.com/rust-analyzer/rust-analyzer/issues/1831): If you are using the popular
4848
[Vim emulation plugin](https://github.com/VSCodeVim/Vim), you will likely
4949
need to turn off the `rust-analyzer.enableEnhancedTyping` setting.
5050

@@ -58,7 +58,7 @@ $ cargo install --path ./crates/ra_lsp_server/ --force --locked
5858
$ cd ./editors/code
5959
$ npm install
6060
$ ./node_modules/vsce/out/vsce package
61-
$ code --install-extension ./ra-lsp-0.0.1.vsix
61+
$ code --install-extension ./rust-analyzer-0.1.0.vsix
6262
```
6363

6464
It's better to remove existing Rust plugins to avoid interference.
@@ -83,7 +83,7 @@ manually install the `.vsix` package:
8383
3. Open the Extensions View (`View > Extensions`, keyboard shortcut: `Ctrl+Shift+X`).
8484
4. From the top-right kebab menu (`···`) select `Install from VSIX...`
8585
5. Inside the `rust-analyzer` directory find the `editors/code` subdirectory and choose
86-
the `ra-lsp-0.0.1.vsix` file.
86+
the `rust-analyzer-0.1.0.vsix` file.
8787
6. Restart Visual Studio Code and re-establish the connection to the remote host.
8888

8989
In case of errors please make sure that `~/.cargo/bin` is in your `PATH` on the remote

editors/code/.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
!out/main.js
33
!package.json
44
!package-lock.json
5+
!icon.png

editors/code/icon.png

17.5 KB
Loading

editors/code/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editors/code/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"name": "ra-lsp",
3-
"displayName": "ra-lsp",
2+
"name": "rust-analyzer",
3+
"displayName": "rust-analyzer",
44
"description": "An alternative rust language server to the RLS",
55
"preview": true,
66
"private": true,
7-
"version": "0.0.1",
7+
"icon": "icon.png",
8+
"version": "0.1.0",
89
"publisher": "matklad",
910
"repository": {
1011
"url": "https://github.com/matklad/rust-analyzer/"

xtask/src/install.rs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,44 @@ fn install_client(ClientOpt::VsCode: ClientOpt) -> Result<()> {
107107
};
108108

109109
Cmd {
110-
unix: &format!(r"{} --install-extension ./ra-lsp-0.0.1.vsix --force", code_binary),
110+
unix: &format!(r"{} --install-extension ./rust-analyzer-0.1.0.vsix --force", code_binary),
111111
windows: &format!(
112-
r"cmd.exe /c {}.cmd --install-extension ./ra-lsp-0.0.1.vsix --force",
112+
r"cmd.exe /c {}.cmd --install-extension ./rust-analyzer-0.1.0.vsix --force",
113113
code_binary
114114
),
115115
work_dir: "./editors/code",
116116
}
117117
.run()?;
118118

119-
let output = Cmd {
120-
unix: &format!(r"{} --list-extensions", code_binary),
121-
windows: &format!(r"cmd.exe /c {}.cmd --list-extensions", code_binary),
122-
work_dir: ".",
123-
}
124-
.run_with_output()?;
119+
let installed_extensions = {
120+
let output = Cmd {
121+
unix: &format!(r"{} --list-extensions", code_binary),
122+
windows: &format!(r"cmd.exe /c {}.cmd --list-extensions", code_binary),
123+
work_dir: ".",
124+
}
125+
.run_with_output()?;
126+
String::from_utf8(output.stdout)?
127+
};
125128

126-
if !str::from_utf8(&output.stdout)?.contains("ra-lsp") {
129+
if !installed_extensions.contains("rust-analyzer") {
127130
anyhow::bail!(
128131
"Could not install the Visual Studio Code extension. \
129132
Please make sure you have at least NodeJS 10.x together with the latest version of VS Code installed and try again."
130133
);
131134
}
132135

136+
if installed_extensions.contains("ra-lsp") {
137+
Cmd {
138+
unix: &format!(r"{} --uninstall-extension matklad.ra-lsp", code_binary),
139+
windows: &format!(
140+
r"cmd.exe /c {}.cmd --uninstall-extension matklad.ra-lsp",
141+
code_binary
142+
),
143+
work_dir: "./editors/code",
144+
}
145+
.run()?;
146+
}
147+
133148
Ok(())
134149
}
135150

0 commit comments

Comments
 (0)