Skip to content

Commit 9a02e86

Browse files
committed
Switch to rust-analyzer
1 parent 8b3cd1e commit 9a02e86

File tree

15 files changed

+121
-74
lines changed

15 files changed

+121
-74
lines changed

01_wait_forever/.vscode/settings.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}

02_runtime_init/.vscode/settings.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}

05_safe_globals/.vscode/settings.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}

08_timestamps/.vscode/settings.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,12 @@ P.S.: In the future, Chinese :cn: versions of the tutorials will be maintained a
4747
written in a modular fashion which allows for easy porting to other CPU
4848
architectures and/or boards.
4949
- I would really love if someone takes a shot at a **RISC-V** implementation!
50-
- For editing, I recommend [Visual Studio Code] with the [Rust Language Server]
51-
extension.
50+
- For editing, I recommend [Visual Studio Code] with [Rust Analyzer].
5251
- In addition to the tutorial text, also check out the `make doc` command to
5352
browse the code with HTML goodness.
5453

5554
[Visual Studio Code]: https://code.visualstudio.com
56-
[Rust Language Server]: https://github.com/rust-lang/rls
55+
[Rust Analyzer]: https://rust-analyzer.github.io
5756

5857
## 🚀 Ease of use
5958

@@ -86,12 +85,17 @@ curl https://sh.rustup.rs -sSf \
8685
| \
8786
sh -s -- \
8887
--default-toolchain nightly-2019-12-20 \
89-
--component rust-src llvm-tools-preview rustfmt rls rust-analysis
88+
--component rust-src llvm-tools-preview rustfmt
9089

9190
source $HOME/.cargo/env
9291
cargo install cargo-xbuild cargo-binutils
9392
```
9493

94+
In case you use `Visual Studio Code`, I strongly recommend installing the
95+
[Rust Analyzer extension] as well.
96+
97+
[Rust Analyzer extension]: https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer
98+
9599
## 📟 USB Serial Output
96100

97101
Since the kernel developed in the tutorials runs on the real hardware, it is
@@ -133,3 +137,4 @@ at your option.
133137
Unless you explicitly state otherwise, any contribution intentionally submitted
134138
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
135139
dual licensed as above, without any additional terms or conditions.
140+

X1_JTAG_boot/.vscode/settings.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"rust.features": [
4-
"bsp_rpi3"
5-
],
6-
"rust.all_targets": false,
73
"editor.rulers": [
84
100
95
],
10-
}
6+
"rust-analyzer.cargoFeatures.features": [
7+
"bsp_rpi3"
8+
],
9+
"rust-analyzer.cargo-watch.allTargets": false,
10+
"rust-analyzer.cargo-watch.arguments": [
11+
"--target=aarch64-unknown-none-softfloat"
12+
]
13+
}

0 commit comments

Comments
 (0)