Added the rust-analyzer.checkOnSave.features option.

This commit is contained in:
Clemens Wasser 2020-06-10 08:51:11 +02:00
parent 684b6fa1b8
commit 47ef544fa5
2 changed files with 12 additions and 1 deletions

View file

@ -242,7 +242,10 @@ impl Config {
set(value, "/checkOnSave/command", command);
set(value, "/checkOnSave/allTargets", all_targets);
set(value, "/checkOnSave/allFeatures", all_features);
*features = self.cargo.features.clone();
set(value, "/checkOnSave/features", features);
if features.is_empty() && !self.cargo.features.is_empty() {
*features = self.cargo.features.clone();
}
}
}
};

View file

@ -322,6 +322,14 @@
"default": false,
"markdownDescription": "Check with all features (will be passed as `--all-features`)"
},
"rust-analyzer.checkOnSave.features": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "List of features to activate. Set to `rust-analyzer.cargo.features` if empty."
},
"rust-analyzer.inlayHints.enable": {
"type": "boolean",
"default": true,