Skip to content

Commit 27239fb

Browse files
committed
Auto merge of rust-lang#14183 - lnicola:rustfmt-command-docs, r=lowr
minor: Try to improve the `rustfmt.overrideCommand` docs Closes rust-lang#14078
2 parents e59ada9 + 563bd9c commit 27239fb

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,10 @@ config_data! {
456456
/// Additional arguments to `rustfmt`.
457457
rustfmt_extraArgs: Vec<String> = "[]",
458458
/// Advanced option, fully override the command rust-analyzer uses for
459-
/// formatting.
459+
/// formatting. This should be the equivalent of `rustfmt` here, and
460+
/// not that of `cargo fmt`. The file contents will be passed on the
461+
/// standard input and the formatted result will be read from the
462+
/// standard output.
460463
rustfmt_overrideCommand: Option<Vec<String>> = "null",
461464
/// Enables the use of rustfmt's unstable range formatting command for the
462465
/// `textDocument/rangeFormatting` request. The rustfmt option is unstable and only

docs/user/generated_config.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,10 @@ Additional arguments to `rustfmt`.
699699
+
700700
--
701701
Advanced option, fully override the command rust-analyzer uses for
702-
formatting.
702+
formatting. This should be the equivalent of `rustfmt` here, and
703+
not that of `cargo fmt`. The file contents will be passed on the
704+
standard input and the formatted result will be read from the
705+
standard output.
703706
--
704707
[[rust-analyzer.rustfmt.rangeFormatting.enable]]rust-analyzer.rustfmt.rangeFormatting.enable (default: `false`)::
705708
+

editors/code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@
12831283
}
12841284
},
12851285
"rust-analyzer.rustfmt.overrideCommand": {
1286-
"markdownDescription": "Advanced option, fully override the command rust-analyzer uses for\nformatting.",
1286+
"markdownDescription": "Advanced option, fully override the command rust-analyzer uses for\nformatting. This should be the equivalent of `rustfmt` here, and\nnot that of `cargo fmt`. The file contents will be passed on the\nstandard input and the formatted result will be read from the\nstandard output.",
12871287
"default": null,
12881288
"type": [
12891289
"null",

0 commit comments

Comments
 (0)