Skip to content

Commit ddfebe4

Browse files
danielsnadpaco-aws
authored andcommitted
Get VS Code working again (rust-lang#766)
* Added extra config to cargo.toml * Developer documentation * Apply suggestions from code review Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com> * Added lines to bookrunner cargo.toml Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
1 parent cb8455f commit ddfebe4

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

kani-docs/src/dev-documentation.md

+23
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,29 @@ git log --graph --oneline origin/upstream-rustc..origin/main
9696
git diff --stat origin/upstream-rustc..origin/main
9797
```
9898

99+
## Set up `rust-analyzer` in VSCode
100+
101+
Add the following to the `rust-analyzer` extension settings in `settings.json`:
102+
```
103+
"rust-analyzer.updates.channel": "nightly",
104+
"rust-analyzer.rustcSource": "discover",
105+
"rust-analyzer.workspace.symbol.search.scope": "workspace_and_dependencies",
106+
```
107+
108+
Ensure that any packages that use `rustc` data structures have the following line set in their `Cargo.toml`
109+
110+
```
111+
[package.metadata.rust-analyzer]
112+
# This package uses rustc crates.
113+
rustc_private=true
114+
```
115+
116+
You may also need to install the `rustc-dev` package using rustup
117+
118+
```
119+
rustup toolchain install nightly --component rustc-dev
120+
```
121+
99122
## Kani command cheat sheet
100123

101124
These can help understand what Kani is generating or encountering on an example or test file:

src/kani-compiler/rustc_codegen_kani/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ kani_queries = { path = "../kani_queries" }
2525
kani_restrictions = { path = "../../../library/kani_restrictions" }
2626
rustc-demangle = "0.1.21"
2727
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
28+
29+
[package.metadata.rust-analyzer]
30+
rustc_private=true

src/tools/bookrunner/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ walkdir = "2.3.2"
1414
serde = { version = "1.0", features = ["derive"] }
1515
serde_json = "1.0"
1616
toml = "0.5"
17+
18+
[package.metadata.rust-analyzer]
19+
# This package uses rustc crates.
20+
rustc_private=true

0 commit comments

Comments
 (0)