diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2024-01-03 21:23:55 +0100 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2024-01-04 15:24:51 +0100 |
| commit | 6fea128f8c859a3f63e6ca684083419ca00d58d3 (patch) | |
| tree | b8f30321d0131cc337479172941dd53d3305d5e7 | |
| parent | b3b36e91c6acdf11d3d4c7a1d0225ab320d38207 (diff) | |
| download | rust-6fea128f8c859a3f63e6ca684083419ca00d58d3.tar.gz rust-6fea128f8c859a3f63e6ca684083419ca00d58d3.zip | |
Use `rust-analyzer.rustc.source` to get r-a working with rustc
| -rw-r--r-- | .vscode/settings.json | 3 | ||||
| -rw-r--r-- | Readme.md | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 834a1362caf..491646ce59b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,9 @@ { "editor.formatOnSave": true, - // source for rustc_* is not included in the rust-src component; disable the errors about this + // in case rustc.source is disabled for performance reasons; disable the errors about this "rust-analyzer.diagnostics.disabled": ["unresolved-extern-crate", "unresolved-macro-call"], + "rust-analyzer.rustc.source": "discover", "rust-analyzer.imports.granularity.enforce": true, "rust-analyzer.imports.granularity.group": "module", "rust-analyzer.imports.prefix": "crate", diff --git a/Readme.md b/Readme.md index 1c48097da2a..4f455261963 100644 --- a/Readme.md +++ b/Readme.md @@ -121,6 +121,8 @@ You need to do this steps to successfully compile and use the cranelift backend * (Optional) run tests: `rustup run stage2 ./y.sh test` 8. Now you can use your cg_clif build to compile other Rust programs, e.g. you can open any Rust crate and run commands like `$RustCheckoutDir/compiler/rustc_codegen_cranelift/dist/cargo-clif build --release`. +You can also set `rust-analyzer.rustc.source` to your rust workspace to get rust-analyzer to understand your changes. + ## Configuration See the documentation on the `BackendConfig` struct in [config.rs](src/config.rs) for all |
