diff options
-rw-r--r-- | crates/rust-analyzer/src/config.rs | 11 | ||||
-rw-r--r-- | editors/code/package.json | 7 |
2 files changed, 7 insertions, 11 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 617612dc3..1253db836 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs | |||
@@ -241,15 +241,8 @@ impl Config { | |||
241 | set(value, "/checkOnSave/extraArgs", extra_args); | 241 | set(value, "/checkOnSave/extraArgs", extra_args); |
242 | set(value, "/checkOnSave/command", command); | 242 | set(value, "/checkOnSave/command", command); |
243 | set(value, "/checkOnSave/allTargets", all_targets); | 243 | set(value, "/checkOnSave/allTargets", all_targets); |
244 | if let Some(new_all_features) = get(value, "/checkOnSave/allFeatures") { | 244 | *all_features = get(value, "/checkOnSave/allFeatures").unwrap_or(self.cargo.all_features); |
245 | *all_features = new_all_features; | 245 | *features = get(value, "/checkOnSave/features").unwrap_or(self.cargo.features.clone()); |
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 | } | ||
253 | } | 246 | } |
254 | } | 247 | } |
255 | }; | 248 | }; |
diff --git a/editors/code/package.json b/editors/code/package.json index 647c83685..e2027970d 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -326,11 +326,14 @@ | |||
326 | "markdownDescription": "Check with all features (will be passed as `--all-features`). Defaults to `rust-analyzer.cargo.allFeatures`." | 326 | "markdownDescription": "Check with all features (will be passed as `--all-features`). Defaults to `rust-analyzer.cargo.allFeatures`." |
327 | }, | 327 | }, |
328 | "rust-analyzer.checkOnSave.features": { | 328 | "rust-analyzer.checkOnSave.features": { |
329 | "type": "array", | 329 | "type": [ |
330 | "null", | ||
331 | "array" | ||
332 | ], | ||
330 | "items": { | 333 | "items": { |
331 | "type": "string" | 334 | "type": "string" |
332 | }, | 335 | }, |
333 | "default": [], | 336 | "default": null, |
334 | "description": "List of features to activate. Defaults to `rust-analyzer.cargo.features`." | 337 | "description": "List of features to activate. Defaults to `rust-analyzer.cargo.features`." |
335 | }, | 338 | }, |
336 | "rust-analyzer.inlayHints.enable": { | 339 | "rust-analyzer.inlayHints.enable": { |