Add config for supplying sysroot path

This commit is contained in:
Lukas Wirth
2022-10-01 20:47:31 +02:00
parent bf5cad8e77
commit 5424c51158
10 changed files with 88 additions and 41 deletions

View File

@@ -24,7 +24,7 @@ use ide_db::base_db::{
use itertools::Itertools;
use oorandom::Rand32;
use profile::{Bytes, StopWatch};
use project_model::{CargoConfig, ProjectManifest, ProjectWorkspace};
use project_model::{CargoConfig, ProjectManifest, ProjectWorkspace, RustcSource};
use rayon::prelude::*;
use rustc_hash::FxHashSet;
use stdx::format_to;
@@ -55,7 +55,10 @@ impl flags::AnalysisStats {
};
let mut cargo_config = CargoConfig::default();
cargo_config.no_sysroot = self.no_sysroot;
cargo_config.sysroot = match self.no_sysroot {
true => None,
false => Some(RustcSource::Discover),
};
let load_cargo_config = LoadCargoConfig {
load_out_dirs_from_check: !self.disable_build_scripts,
with_proc_macro: !self.disable_proc_macros,