-
I've noticed that when rust-analyzer runs it seems to re-build std every time, and then when I go to build/run on the command line with My settings.json in vscode contains these flags to pass to rust-analyzer "rust-analyzer.cargo.target": "armv6k-nintendo-3ds",
"rust-analyzer.cargo.extraArgs": [
"-Zbuild-std"
] Is anyone else using vscode and can share their settings? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This behaviour also happens when normally executing this build command (rather than You just need to export the env configuration you can see around here. In simpler terms, add {
"rust-analyzer.cargo.extraEnv": { "RUSTFLAGS": "-L/opt/devkitpro/libctru/lib -lctru" }
} As any good programmer would, I don't use this, because I much prefer having |
Beta Was this translation helpful? Give feedback.
-
I actually have been using rust-analyzer and codelldb for quite a while with this project. All i had to do was change the "check" command in the settings over to "cargo 3ds check" (remember to set the output to json too). You can even change the command per-project as to not have to re-change it every time you interact with a non-3ds rust project.
{
"rust-analyzer.check.overrideCommand": [
"cargo",
"3ds",
"check",
"--message-format=json"
],
} As for running, i have a launch.json like this that uses codelldb and the Luma3DS GDB server. |
Beta Was this translation helpful? Give feedback.
This behaviour also happens when normally executing this build command (rather than
cargo 3ds build
):cargo build --target armv6k-nintendo-3ds -Zbuild-std --lib
You just need to export the env configuration you can see around here.
In simpler terms, add
RUSTFLAGS="-L/opt/devkitpro/libctru/lib -lctru"
to your env.As any good programmer would, I don't use this, because I much prefer having
rust-analyzer
spit wrong errors than having to use a configuration file for VSCode :P