mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Rename defaultTarget
to target
This commit is contained in:
parent
e7523511ce
commit
0ab4340cdb
3 changed files with 6 additions and 6 deletions
|
@ -58,7 +58,7 @@ pub struct CargoConfig {
|
||||||
pub load_out_dirs_from_check: bool,
|
pub load_out_dirs_from_check: bool,
|
||||||
|
|
||||||
/// rustc target
|
/// rustc target
|
||||||
pub default_target: Option<String>,
|
pub target: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for CargoConfig {
|
impl Default for CargoConfig {
|
||||||
|
@ -68,7 +68,7 @@ impl Default for CargoConfig {
|
||||||
all_features: true,
|
all_features: true,
|
||||||
features: Vec::new(),
|
features: Vec::new(),
|
||||||
load_out_dirs_from_check: false,
|
load_out_dirs_from_check: false,
|
||||||
default_target: None,
|
target: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ impl CargoWorkspace {
|
||||||
if let Some(parent) = cargo_toml.parent() {
|
if let Some(parent) = cargo_toml.parent() {
|
||||||
meta.current_dir(parent);
|
meta.current_dir(parent);
|
||||||
}
|
}
|
||||||
if let Some(target) = cargo_features.default_target.as_ref() {
|
if let Some(target) = cargo_features.target.as_ref() {
|
||||||
meta.other_options(&[String::from("--filter-platform"), target.clone()]);
|
meta.other_options(&[String::from("--filter-platform"), target.clone()]);
|
||||||
}
|
}
|
||||||
let meta = meta.exec().with_context(|| {
|
let meta = meta.exec().with_context(|| {
|
||||||
|
|
|
@ -134,7 +134,7 @@ impl Config {
|
||||||
set(value, "/cargo/allFeatures", &mut self.cargo.all_features);
|
set(value, "/cargo/allFeatures", &mut self.cargo.all_features);
|
||||||
set(value, "/cargo/features", &mut self.cargo.features);
|
set(value, "/cargo/features", &mut self.cargo.features);
|
||||||
set(value, "/cargo/loadOutDirsFromCheck", &mut self.cargo.load_out_dirs_from_check);
|
set(value, "/cargo/loadOutDirsFromCheck", &mut self.cargo.load_out_dirs_from_check);
|
||||||
set(value, "/cargo/defaultTarget", &mut self.cargo.default_target);
|
set(value, "/cargo/target", &mut self.cargo.target);
|
||||||
|
|
||||||
match get(value, "/procMacro/enable") {
|
match get(value, "/procMacro/enable") {
|
||||||
Some(true) => {
|
Some(true) => {
|
||||||
|
|
|
@ -237,13 +237,13 @@
|
||||||
"default": false,
|
"default": false,
|
||||||
"markdownDescription": "Run `cargo check` on startup to get the correct value for package OUT_DIRs"
|
"markdownDescription": "Run `cargo check` on startup to get the correct value for package OUT_DIRs"
|
||||||
},
|
},
|
||||||
"rust-analyzer.cargo.defaultTarget": {
|
"rust-analyzer.cargo.target": {
|
||||||
"type": [
|
"type": [
|
||||||
"null",
|
"null",
|
||||||
"string"
|
"string"
|
||||||
],
|
],
|
||||||
"default": null,
|
"default": null,
|
||||||
"description": "Specify the default target"
|
"description": "Specify the compilation target"
|
||||||
},
|
},
|
||||||
"rust-analyzer.rustfmt.extraArgs": {
|
"rust-analyzer.rustfmt.extraArgs": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
|
Loading…
Reference in a new issue