You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Getting code-completion for rustc internals to work
97
+
98
+
Unfortunately, [`rust-analyzer`][ra_homepage] does not (yet?) understand how clippy uses compiler-internals using `extern crate` and it also needs to be able to read the source files of the rustc-compiler which are not available via a `rustup` component at the time of writing.
99
+
To work around this, you need to have a copy of the a [rustc-repo][rustc_repo] available which can be obtained via `git clone https://github.com/rust-lang/rust/`.
100
+
Then you can run a `cargo dev` command to automatically make clippy use the rustc-repo via path-dependencies which rust-analyzer will be able to understand.
101
+
Run `cargo dev ra-setup --repo-path <repo-path>` where `<repo-path>` is an absolute path to the rustc repo you just cloned.
102
+
The command will add path-dependencies pointing towards rustc-crates inside the rustc repo to clippys `Cargo.toml`s and should allow rust-analyzer to understand most of the type that clippy uses.
103
+
Just make sure to remove the dependencies again before finally making a pull request!
0 commit comments