Skip to content

Commit 33b9058

Browse files
committed
Most of the checkOnSafe options now default to the cargo equivalent.
1 parent 47ef544 commit 33b9058

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ impl Config {
241241
set(value, "/checkOnSave/extraArgs", extra_args);
242242
set(value, "/checkOnSave/command", command);
243243
set(value, "/checkOnSave/allTargets", all_targets);
244-
set(value, "/checkOnSave/allFeatures", all_features);
244+
if let Some(new_all_features) = get(value, "/checkOnSave/allFeatures") {
245+
*all_features = new_all_features;
246+
} else {
247+
*all_features = self.cargo.all_features;
248+
}
245249
set(value, "/checkOnSave/features", features);
246250
if features.is_empty() && !self.cargo.features.is_empty() {
247251
*features = self.cargo.features.clone();

editors/code/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,17 +318,20 @@
318318
"markdownDescription": "Check all targets and tests (will be passed as `--all-targets`)"
319319
},
320320
"rust-analyzer.checkOnSave.allFeatures": {
321-
"type": "boolean",
322-
"default": false,
323-
"markdownDescription": "Check with all features (will be passed as `--all-features`)"
321+
"type": [
322+
"null",
323+
"boolean"
324+
],
325+
"default": null,
326+
"markdownDescription": "Check with all features (will be passed as `--all-features`). Defaults to `rust-analyzer.cargo.allFeatures`."
324327
},
325328
"rust-analyzer.checkOnSave.features": {
326329
"type": "array",
327330
"items": {
328331
"type": "string"
329332
},
330333
"default": [],
331-
"description": "List of features to activate. Set to `rust-analyzer.cargo.features` if empty."
334+
"description": "List of features to activate. Defaults to `rust-analyzer.cargo.features`."
332335
},
333336
"rust-analyzer.inlayHints.enable": {
334337
"type": "boolean",

0 commit comments

Comments
 (0)