Skip to content

Commit e69c7f1

Browse files
Update docs to include note about ANSI diagnostics
1 parent 7a40066 commit e69c7f1

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ config_data! {
159159
checkOnSave_noDefaultFeatures: Option<bool> = "null",
160160
/// Override the command rust-analyzer uses instead of `cargo check` for
161161
/// diagnostics on save. The command is required to output json and
162-
/// should therefore include `--message-format=json` or a similar option.
162+
/// should therefore include `--message-format=json` or a similar option
163+
/// (for colored diagnostics, use
164+
/// `--message-format=json-diagnostic-rendered-ansi`).
163165
///
164166
/// If you're changing this because you're using some tool wrapping
165167
/// Cargo, you might also want to change

docs/user/generated_config.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ Whether to pass `--no-default-features` to Cargo. Defaults to
173173
--
174174
Override the command rust-analyzer uses instead of `cargo check` for
175175
diagnostics on save. The command is required to output json and
176-
should therefore include `--message-format=json` or a similar option.
176+
should therefore include `--message-format=json` or a similar option
177+
(for colored diagnostics, use
178+
`--message-format=json-diagnostic-rendered-ansi`).
177179

178180
If you're changing this because you're using some tool wrapping
179181
Cargo, you might also want to change

editors/code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@
639639
]
640640
},
641641
"rust-analyzer.checkOnSave.overrideCommand": {
642-
"markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefore 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.",
642+
"markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefore include `--message-format=json` or a similar option\n(for colored diagnostics, use\n`--message-format=json-diagnostic-rendered-ansi`).\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.",
643643
"default": null,
644644
"type": [
645645
"null",

0 commit comments

Comments
 (0)