Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 0317ebe

Browse files
authored
Switch from RLS to rust-analyzer (#157)
* Handle r.a progress messages * npm update * Fix completion in atom-languageclient fork * Update dependencies * Update to use rust-analyzer by default * Remove RLS stuff * Update readmes * Keep some dead code that may be re-used when r.a is on the release trains
1 parent 4ed5f3e commit 0317ebe

File tree

6 files changed

+451
-644
lines changed

6 files changed

+451
-644
lines changed

README.md

+14-54
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,35 @@
11
# IDE-Rust
2-
Rust language support for Atom-IDE, powered by the Rust Language Server (RLS).
3-
4-
![](http://image.ibb.co/gwfQTm/output.gif "Usage Jan-2018")
2+
Rust language support for Atom-IDE, powered by [rust-analyzer](https://github.com/rust-analyzer/rust-analyzer).
53

64
## Features
75
- Auto-completion
8-
- Diagnostics (errors and warnings from `rustc` and `clippy`, see `clippy_preference` setting)
6+
- Diagnostics (errors and warnings from `rustc`)
97
- Document outline
108
- Go to definition (`ctrl` or `cmd` click)
119
- Type information and Documentation on hover (hold `ctrl` or `cmd` for more information)
1210
- Find references (`ctrl-alt-shift-f` or `cmd-opt-shift-f` also in context menu)
1311
- Format file with rustfmt (`ctrl-shift-c` or `cmd-shift-c` also in context menu)
1412
- Format on save (disabled by default, see `atom-ide-ui` settings)
15-
- Supports rustup default & override toolchains, or manually select rls toolchain in package settings
16-
- Rls toolchain update checking at startup & every 6 hours thereafter
17-
- Global Rls configuration for `all_targets`, `clippy_preference`
18-
- Per-project Rls configuration using `rls.toml` file at project root, see [rls#configuration](https://github.com/rust-lang-nursery/rls#configuration)
19-
```toml
20-
# rls.toml
21-
features = ["serde"]
22-
```
23-
- Graceful handling of Rls being missing from the distribution _(which is/was somewhat common on the nightly channel)_
24-
* Warns before installing a rust version without Rls or when using an already installed one
25-
* Automatic detection of, and prompt to install, the latest working dated release
13+
- Rustup toolchain update checking at startup & every 6 hours thereafter
14+
- Supports rustup override toolchains
2615
- Rust language snippets
2716

2817
## Install
29-
You can install from the command line with:
18+
Install from Settings view by searching for `ide-rust`, or with the command line:
3019
```
3120
$ apm install ide-rust
3221
```
33-
Or you can install from Settings view by searching for `ide-rust`.
3422

35-
No other packages or manual setup is required as these will be handled with user prompts after install. However, you may wish to install `rustup` with your OS package manager instead of following prompts to install via [rustup.rs](https://rustup.rs).
23+
### Prerequisites
24+
**rust-analyzer** must be installed manually, if possible on the PATH _(otherwise configure this in the package settings)_.
25+
See https://rust-analyzer.github.io/manual.html#rust-analyzer-language-server-binary.
26+
27+
No other packages or manual setup is required as these will be handled with user prompts after install.
28+
However, you may wish to install `rustup` with your OS package manager instead of following prompts to install via [rustup.rs](https://rustup.rs).
3629

3730
## Commands
3831
- `ide-rust:restart-all-language-servers` Restart all currently active Rls processes
3932

40-
## Multi-crate projects
41-
A root `Cargo.toml` is required in each atom project, however cargo workspaces can be used to support multiple crates in a single project.
42-
For example, a project with *'rust_foo'* & *'rust_bar'* directories/crates could have the following root `Cargo.toml`
43-
```toml
44-
# Cargo.toml
45-
[workspace]
46-
members = [
47-
"rust_foo",
48-
"rust_bar",
49-
]
50-
```
51-
52-
Even if you only have a single crate in your Atom project, RLS can only detect it if you
53-
have a root `Cargo.toml`. If your project is setup such that you have one or more crate nested
54-
in folders under the root, you can add a root `Cargo.toml` file and setup a Cargo workspace that
55-
includes all the crates in the project:
56-
```toml
57-
# Cargo.toml
58-
[workspace]
59-
members = [
60-
"foo/bar/rust_foo",
61-
]
62-
```
63-
64-
## Overriding Rls
65-
The Rls command can be specified manually, for example to run from local source code:
66-
```cson
67-
# config.cson
68-
...
69-
"ide-rust":
70-
rlsCommandOverride: "cargo +nightly run --manifest-path=/rls-src/Cargo.toml"
71-
```
72-
When set you'll be able to see, and remove, this from the package settings. After restarting atom an info message will inform you the override is in place.
73-
74-
![](https://image.ibb.co/jsR65w/rls_Command_Override_Info.png)
75-
7633
## Debugging IDE-Rust
7734
If stuff isn't working you can try **enabling logging** to debug:
7835
* Open the atom console _(ctrl-shift-i)_
@@ -81,5 +38,8 @@ If stuff isn't working you can try **enabling logging** to debug:
8138

8239
This will spit out language server message logging into the atom console. Check if requests/responses are being sent or are incorrect. It will also include any Rls stderr messages (as warnings) which may point to Rls bugs.
8340

41+
## RLS
42+
RLS is no longer supported. To use RLS install a previous version of ide-rust, `apm install [email protected]`.
43+
8444
## License
8545
MIT License. See the [license](LICENSE) for more details.

lib/competition.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ const CONFLICTING_PACKAGES = [
33
"languageserver-rust",
44
"tokamak",
55
"atom-rust",
6-
// rls provides lints
6+
// rust-analyzer provides lints
77
"linter-rust",
8-
// rls provides rustfmt functionality
8+
// rust-analyzer provides rustfmt functionality
99
"rustfmt",
10-
// rls provides racer completion
10+
// rust-analyzer provides completion
1111
"racer",
1212
"racer-v2",
1313
"racer-plus",

0 commit comments

Comments
 (0)