Skip to content

Commit 54ffd4e

Browse files
committed
Update suggested config to expand proc macros
1 parent a8add66 commit 54ffd4e

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Diff for: src/building/suggested.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,22 @@ you can write: <!-- date: 2022-04 --><!-- the date comment is for the edition be
3232
"check",
3333
"--json-output"
3434
],
35+
"rust-analyzer.cargo.runBuildScriptsCommand": [
36+
"./build/$TARGET_TRIPLE/stage0/bin/cargo",
37+
"check",
38+
"-p",
39+
"rustc_driver",
40+
"--message-format=json"
41+
],
3542
"rust-analyzer.rustfmt.overrideCommand": [
3643
"./build/$TARGET_TRIPLE/stage0/bin/rustfmt",
3744
"--edition=2021"
3845
],
3946
"editor.formatOnSave": true,
40-
"rust-analyzer.cargo.runBuildScripts": false,
47+
"rust-analyzer.cargo.runBuildScripts": true,
4148
"rust-analyzer.rustcSource": "./Cargo.toml",
42-
"rust-analyzer.procMacro.enable": false
49+
"rust-analyzer.procMacro.enable": true,
50+
"rust-analyzer.cargo.useRustcWrapperForBuildScripts": true
4351
}
4452
```
4553

@@ -56,6 +64,14 @@ If you're running `coc.nvim`, you can use `:CocLocalConfig` to create a
5664
`editor.formatOnSave: true,` with
5765
`"coc.preferences.formatOnSaveFiletypes": ["rust"],`.
5866

67+
> NOTE: The configuration once suggested disabling build scripts, but after
68+
> the version `2022-04-14` this was fixed by introducing an option for customizing
69+
> the command rust-analyzer uses to run build scripts. Please ensure that `rust-analyzer`
70+
> is up to date before enabling these options. If you do not wish to enable
71+
> `rust-analyzer.cargo.useRustcWrapperForBuildScripts`, the
72+
> `rust-analyzer.cargo.runBuildScriptsCommand` option should be set as same as
73+
> `rust-analyzer.checkOnSave.overrideCommand` instead of the suggested value.
74+
5975
If running `./x.py check` on save is inconvenient, in VS Code you can use a [Build
6076
Task] instead:
6177

0 commit comments

Comments
 (0)