This commit is contained in:
Aleksey Kladov
2020-06-11 11:04:09 +02:00
parent 7aa66371ee
commit dad1333b48
46 changed files with 1028 additions and 1001 deletions

View File

@@ -1,5 +1,7 @@
//! See `CargoTargetSpec`
use std::path::PathBuf;
use ra_cfg::CfgExpr;
use ra_ide::{FileId, RunnableKind, TestId};
use ra_project_model::{self, TargetKind};
@@ -12,6 +14,7 @@ use crate::{global_state::GlobalStateSnapshot, Result};
/// build/test/run the target.
#[derive(Clone)]
pub(crate) struct CargoTargetSpec {
pub(crate) workspace_root: PathBuf,
pub(crate) package: String,
pub(crate) target: String,
pub(crate) target_kind: TargetKind,
@@ -101,6 +104,7 @@ impl CargoTargetSpec {
None => return Ok(None),
};
let res = CargoTargetSpec {
workspace_root: cargo_ws.workspace_root().to_path_buf(),
package: cargo_ws.package_flag(&cargo_ws[cargo_ws[target].package]),
target: cargo_ws[target].name.clone(),
target_kind: cargo_ws[target].kind,