mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
AbsPath
This commit is contained in:
parent
6c2f42260c
commit
4be73c2b7f
1 changed files with 3 additions and 3 deletions
|
@ -134,12 +134,12 @@ impl PackageData {
|
||||||
|
|
||||||
impl CargoWorkspace {
|
impl CargoWorkspace {
|
||||||
pub fn from_cargo_metadata(
|
pub fn from_cargo_metadata(
|
||||||
cargo_toml: &Path,
|
cargo_toml: &AbsPath,
|
||||||
cargo_features: &CargoConfig,
|
cargo_features: &CargoConfig,
|
||||||
) -> Result<CargoWorkspace> {
|
) -> Result<CargoWorkspace> {
|
||||||
let mut meta = MetadataCommand::new();
|
let mut meta = MetadataCommand::new();
|
||||||
meta.cargo_path(ra_toolchain::cargo());
|
meta.cargo_path(ra_toolchain::cargo());
|
||||||
meta.manifest_path(cargo_toml);
|
meta.manifest_path(cargo_toml.to_path_buf());
|
||||||
if cargo_features.all_features {
|
if cargo_features.all_features {
|
||||||
meta.features(CargoOpt::AllFeatures);
|
meta.features(CargoOpt::AllFeatures);
|
||||||
} else if cargo_features.no_default_features {
|
} else if cargo_features.no_default_features {
|
||||||
|
@ -150,7 +150,7 @@ impl CargoWorkspace {
|
||||||
meta.features(CargoOpt::SomeFeatures(cargo_features.features.clone()));
|
meta.features(CargoOpt::SomeFeatures(cargo_features.features.clone()));
|
||||||
}
|
}
|
||||||
if let Some(parent) = cargo_toml.parent() {
|
if let Some(parent) = cargo_toml.parent() {
|
||||||
meta.current_dir(parent);
|
meta.current_dir(parent.to_path_buf());
|
||||||
}
|
}
|
||||||
if let Some(target) = cargo_features.target.as_ref() {
|
if let Some(target) = cargo_features.target.as_ref() {
|
||||||
meta.other_options(vec![String::from("--filter-platform"), target.clone()]);
|
meta.other_options(vec![String::from("--filter-platform"), target.clone()]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue