Skip to content

Commit c32ab97

Browse files
committed
Auto merge of #13065 - RalfJung:override-command-docs, r=Veykril
document interaction of checkOnSave.overrideCommand and multiple linked projects Cc #10793 r? `@Veykril`
2 parents 2f02ea0 + c5455d1 commit c32ab97

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

crates/rust-analyzer/src/config.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ mod patch_old_style;
4545
// - foo_command = overrides the subcommand, foo_overrideCommand allows full overwriting, extra args only applies for foo_command
4646

4747
// Defines the server-side configuration of the rust-analyzer. We generate
48-
// *parts* of VS Code's `package.json` config from this.
48+
// *parts* of VS Code's `package.json` config from this. Run `cargo test` to
49+
// re-generate that file.
4950
//
5051
// However, editor specific config, which the server doesn't know about, should
5152
// be specified directly in `package.json`.
@@ -120,6 +121,10 @@ config_data! {
120121
/// Cargo, you might also want to change
121122
/// `#rust-analyzer.cargo.buildScripts.overrideCommand#`.
122123
///
124+
/// If there are multiple linked projects, this command is invoked for
125+
/// each of them, with the working directory being the project root
126+
/// (i.e., the folder containing the `Cargo.toml`).
127+
///
123128
/// An example command would be:
124129
///
125130
/// ```bash

docs/user/generated_config.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ If you're changing this because you're using some tool wrapping
118118
Cargo, you might also want to change
119119
`#rust-analyzer.cargo.buildScripts.overrideCommand#`.
120120

121+
If there are multiple linked projects, this command is invoked for
122+
each of them, with the working directory being the project root
123+
(i.e., the folder containing the `Cargo.toml`).
124+
121125
An example command would be:
122126

123127
```bash

editors/code/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@
547547
]
548548
},
549549
"rust-analyzer.checkOnSave.overrideCommand": {
550-
"markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefor include `--message-format=json` or a similar option.\n\nIf you're changing this because you're using some tool wrapping\nCargo, you might also want to change\n`#rust-analyzer.cargo.buildScripts.overrideCommand#`.\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n.",
550+
"markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefor include `--message-format=json` or a similar option.\n\nIf you're changing this because you're using some tool wrapping\nCargo, you might also want to change\n`#rust-analyzer.cargo.buildScripts.overrideCommand#`.\n\nIf there are multiple linked projects, this command is invoked for\neach of them, with the working directory being the project root\n(i.e., the folder containing the `Cargo.toml`).\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n.",
551551
"default": null,
552552
"type": [
553553
"null",

0 commit comments

Comments
 (0)