Skip to content

Commit

Permalink
Update suggested config to expand proc macros
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Apr 15, 2022
1 parent a8add66 commit 490c9ef
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/building/suggested.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,22 @@ you can write: <!-- date: 2022-04 --><!-- the date comment is for the edition be
"check",
"--json-output"
],
"rust-analyzer.cargo.runBuildScriptsCommand": [
"cargo",
"check",
"-p",
"rustc_driver",
"--message-format=json"
],
"rust-analyzer.rustfmt.overrideCommand": [
"./build/$TARGET_TRIPLE/stage0/bin/rustfmt",
"--edition=2021"
],
"editor.formatOnSave": true,
"rust-analyzer.cargo.runBuildScripts": false,
"rust-analyzer.cargo.runBuildScripts": true,
"rust-analyzer.rustcSource": "./Cargo.toml",
"rust-analyzer.procMacro.enable": false
"rust-analyzer.procMacro.enable": true,
"rust-analyzer.cargo.useRustcWrapperForBuildScripts": true
}
```

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

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

Expand Down

0 comments on commit 490c9ef

Please sign in to comment.