@@ -12,7 +12,6 @@ use ide::{
1212} ;
1313use ide_db:: LineIndexDatabase ;
1414use load_cargo:: { load_workspace_at, LoadCargoConfig , ProcMacroServerChoice } ;
15- use project_model:: { CargoConfig , RustLibSource } ;
1615use scip:: types as scip_types;
1716
1817use crate :: {
@@ -24,8 +23,6 @@ impl flags::Scip {
2423 pub fn run ( self ) -> anyhow:: Result < ( ) > {
2524 eprintln ! ( "Generating SCIP start..." ) ;
2625 let now = Instant :: now ( ) ;
27- let mut cargo_config = CargoConfig :: default ( ) ;
28- cargo_config. sysroot = Some ( RustLibSource :: Discover ) ;
2926
3027 let no_progress = & |s| ( eprintln ! ( "rust-analyzer: Loading {s}" ) ) ;
3128 let load_cargo_config = LoadCargoConfig {
@@ -34,6 +31,20 @@ impl flags::Scip {
3431 prefill_caches : true ,
3532 } ;
3633 let root = vfs:: AbsPathBuf :: assert ( std:: env:: current_dir ( ) ?. join ( & self . path ) ) . normalize ( ) ;
34+
35+ let mut config = crate :: config:: Config :: new (
36+ root. clone ( ) ,
37+ lsp_types:: ClientCapabilities :: default ( ) ,
38+ /* workspace_roots = */ vec ! [ ] ,
39+ /* is_visual_studio_code = */ false ,
40+ ) ;
41+
42+ if let Some ( p) = self . config_path {
43+ let mut file = std:: io:: BufReader :: new ( std:: fs:: File :: open ( p) ?) ;
44+ let json = serde_json:: from_reader ( & mut file) ?;
45+ config. update ( json) ?;
46+ }
47+ let cargo_config = config. cargo ( ) ;
3748 let ( host, vfs, _) = load_workspace_at (
3849 root. as_path ( ) . as_ref ( ) ,
3950 & cargo_config,
0 commit comments