Skip to content

Commit fe21fc2

Browse files
committed
checkOnSafe.features and checkOnSafe.allFeatures now work identically.
1 parent 33b9058 commit fe21fc2

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,8 @@ impl Config {
241241
set(value, "/checkOnSave/extraArgs", extra_args);
242242
set(value, "/checkOnSave/command", command);
243243
set(value, "/checkOnSave/allTargets", all_targets);
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-
}
249-
set(value, "/checkOnSave/features", features);
250-
if features.is_empty() && !self.cargo.features.is_empty() {
251-
*features = self.cargo.features.clone();
252-
}
244+
*all_features = get(value, "/checkOnSave/allFeatures").unwrap_or(self.cargo.all_features);
245+
*features = get(value, "/checkOnSave/features").unwrap_or(self.cargo.features.clone());
253246
}
254247
}
255248
};

editors/code/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,14 @@
326326
"markdownDescription": "Check with all features (will be passed as `--all-features`). Defaults to `rust-analyzer.cargo.allFeatures`."
327327
},
328328
"rust-analyzer.checkOnSave.features": {
329-
"type": "array",
329+
"type": [
330+
"null",
331+
"array"
332+
],
330333
"items": {
331334
"type": "string"
332335
},
333-
"default": [],
336+
"default": null,
334337
"description": "List of features to activate. Defaults to `rust-analyzer.cargo.features`."
335338
},
336339
"rust-analyzer.inlayHints.enable": {

0 commit comments

Comments
 (0)