The automatic installation is expected to *just work* for common cases, if it
doesn't, report bugs!
-**Note** [#1831](https://github.com/rust-analyzer/rust-analyzer/issues/1831): If you are using the popular
+**Note** [#1831](https://github.com/rust-analyzer/rust-analyzer/issues/1831): If you are using the popular
[Vim emulation plugin](https://github.com/VSCodeVim/Vim), you will likely
need to turn off the `rust-analyzer.enableEnhancedTyping` setting.
$ cd ./editors/code
$ npm install
$ ./node_modules/vsce/out/vsce package
-$ code --install-extension ./ra-lsp-0.0.1.vsix
+$ code --install-extension ./rust-analyzer-0.1.0.vsix
```
It's better to remove existing Rust plugins to avoid interference.
3. Open the Extensions View (`View > Extensions`, keyboard shortcut: `Ctrl+Shift+X`).
4. From the top-right kebab menu (`ยทยทยท`) select `Install from VSIX...`
5. Inside the `rust-analyzer` directory find the `editors/code` subdirectory and choose
- the `ra-lsp-0.0.1.vsix` file.
+ the `rust-analyzer-0.1.0.vsix` file.
6. Restart Visual Studio Code and re-establish the connection to the remote host.
In case of errors please make sure that `~/.cargo/bin` is in your `PATH` on the remote
{
- "name": "ra-lsp",
- "displayName": "ra-lsp",
+ "name": "rust-analyzer",
+ "displayName": "rust-analyzer",
"description": "An alternative rust language server to the RLS",
"preview": true,
"private": true,
- "version": "0.0.1",
+ "icon": "icon.png",
+ "version": "0.1.0",
"publisher": "matklad",
"repository": {
"url": "https://github.com/matklad/rust-analyzer/"
};
Cmd {
- unix: &format!(r"{} --install-extension ./ra-lsp-0.0.1.vsix --force", code_binary),
+ unix: &format!(r"{} --install-extension ./rust-analyzer-0.1.0.vsix --force", code_binary),
windows: &format!(
- r"cmd.exe /c {}.cmd --install-extension ./ra-lsp-0.0.1.vsix --force",
+ r"cmd.exe /c {}.cmd --install-extension ./rust-analyzer-0.1.0.vsix --force",
code_binary
),
work_dir: "./editors/code",
}
.run()?;
- let output = Cmd {
- unix: &format!(r"{} --list-extensions", code_binary),
- windows: &format!(r"cmd.exe /c {}.cmd --list-extensions", code_binary),
- work_dir: ".",
- }
- .run_with_output()?;
+ let installed_extensions = {
+ let output = Cmd {
+ unix: &format!(r"{} --list-extensions", code_binary),
+ windows: &format!(r"cmd.exe /c {}.cmd --list-extensions", code_binary),
+ work_dir: ".",
+ }
+ .run_with_output()?;
+ String::from_utf8(output.stdout)?
+ };
- if !str::from_utf8(&output.stdout)?.contains("ra-lsp") {
+ if !installed_extensions.contains("rust-analyzer") {
anyhow::bail!(
"Could not install the Visual Studio Code extension. \
Please make sure you have at least NodeJS 10.x together with the latest version of VS Code installed and try again."
);
}
+ if installed_extensions.contains("ra-lsp") {
+ Cmd {
+ unix: &format!(r"{} --uninstall-extension matklad.ra-lsp", code_binary),
+ windows: &format!(
+ r"cmd.exe /c {}.cmd --uninstall-extension matklad.ra-lsp",
+ code_binary
+ ),
+ work_dir: "./editors/code",
+ }
+ .run()?;
+ }
+
Ok(())
}