Skip to content

Commit ba9afaf

Browse files
committed
Auto merge of #9478 - Alexendoo:ra-docs, r=flip1995
Update rust-analyzer documentation, mention linkedProjects r-a uses the `rustc-dev` component from the rustup installed toolchain clippy specifies so it doesn't need to be manually installed. Also remove references to nightly r-a as the feature is long stable I discovered `rust-analyzer.linkedProjects` recently and it has made working on the crates not referenced by the `clippy` crate so much nicer changelog: none
2 parents e585b71 + ba717aa commit ba9afaf

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,28 @@ Just make sure to remove the dependencies again before finally making a pull req
110110
[IntelliJ_rust_homepage]: https://intellij-rust.github.io/
111111

112112
### Rust Analyzer
113-
As of [#6869][6869], [`rust-analyzer`][ra_homepage] can understand that Clippy uses compiler-internals
114-
using `extern crate` when `package.metadata.rust-analyzer.rustc_private` is set to `true` in Clippy's `Cargo.toml.`
115-
You will require a `nightly` toolchain with the `rustc-dev` component installed.
116-
Make sure that in the `rust-analyzer` configuration, you set
113+
For [`rust-analyzer`][ra_homepage] to work correctly make sure that in the `rust-analyzer` configuration you set
114+
117115
```json
118116
{ "rust-analyzer.rustc.source": "discover" }
119117
```
120-
and
121-
```json
122-
{ "rust-analyzer.updates.channel": "nightly" }
123-
```
118+
124119
You should be able to see information on things like `Expr` or `EarlyContext` now if you hover them, also
125120
a lot more type hints.
126-
This will work with `rust-analyzer 2021-03-15` shipped in nightly `1.52.0-nightly (107896c32 2021-03-15)` or later.
121+
122+
To have `rust-analyzer` also work in the `clippy_dev` and `lintcheck` crates, add the following configuration
123+
124+
```json
125+
{
126+
"rust-analyzer.linkedProjects": [
127+
"./Cargo.toml",
128+
"clippy_dev/Cargo.toml",
129+
"lintcheck/Cargo.toml",
130+
]
131+
}
132+
```
127133

128134
[ra_homepage]: https://rust-analyzer.github.io/
129-
[6869]: https://github.com/rust-lang/rust-clippy/pull/6869
130135

131136
## How Clippy works
132137

0 commit comments

Comments
 (0)