@@ -12,7 +12,6 @@ use ide::{
12
12
} ;
13
13
use ide_db:: LineIndexDatabase ;
14
14
use load_cargo:: { load_workspace_at, LoadCargoConfig , ProcMacroServerChoice } ;
15
- use project_model:: { CargoConfig , RustLibSource } ;
16
15
use scip:: types as scip_types;
17
16
18
17
use crate :: {
@@ -24,8 +23,6 @@ impl flags::Scip {
24
23
pub fn run ( self ) -> anyhow:: Result < ( ) > {
25
24
eprintln ! ( "Generating SCIP start..." ) ;
26
25
let now = Instant :: now ( ) ;
27
- let mut cargo_config = CargoConfig :: default ( ) ;
28
- cargo_config. sysroot = Some ( RustLibSource :: Discover ) ;
29
26
30
27
let no_progress = & |s| ( eprintln ! ( "rust-analyzer: Loading {s}" ) ) ;
31
28
let load_cargo_config = LoadCargoConfig {
@@ -34,6 +31,20 @@ impl flags::Scip {
34
31
prefill_caches : true ,
35
32
} ;
36
33
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 ( ) ;
37
48
let ( host, vfs, _) = load_workspace_at (
38
49
root. as_path ( ) . as_ref ( ) ,
39
50
& cargo_config,
0 commit comments