Skip to content

Commit 8f33dba

Browse files
committed
docs: write documentation for enabling rust-analyzer
1 parent 6c87dc8 commit 8f33dba

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,27 @@ rustlings list
124124

125125
After every couple of sections, there will be a quiz that'll test your knowledge on a bunch of sections at once. These quizzes are found in `exercises/quizN.rs`.
126126

127+
## Enabling `rust-analyzer`
128+
129+
`rust-analyzer` support is provided, but it depends on your editor
130+
whether it's enabled by default. (RLS support is not provided)
131+
132+
To enable `rust-analyzer`, you'll need to make Cargo build the project
133+
with the `exercises` feature, which will automatically include the `exercises/`
134+
subfolder in the project. The easiest way to do this is to tell your editor to
135+
build the project with all features (the equivalent of `cargo build --all-features`).
136+
For specific editor instructions:
137+
138+
- **VSCode**: Add a `.vscode/settings.json` file with the following:
139+
```json
140+
{
141+
"rust-analyzer.cargo.features": ["exercises"]
142+
}
143+
```
144+
- **IntelliJ-based Editors**: Using the Rust plugin, everything should work
145+
by default.
146+
- _Missing your editor? Feel free to contribute more instructions!_
147+
127148
## Continuing On
128149

129150
Once you've completed Rustlings, put your new knowledge to good use! Continue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to.

0 commit comments

Comments
 (0)