This repository was archived by the owner on Dec 29, 2022. It is now read-only.
File tree 2 files changed +9
-5
lines changed 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -309,11 +309,16 @@ impl InitActionContext {
309
309
fn init < O : Output > ( & self , init_options : InitializationOptions , out : & O ) {
310
310
let current_project = self . current_project . clone ( ) ;
311
311
312
- if let Some ( config) = init_options. settings . map ( |s| s. rust ) {
313
- self . config . lock ( ) . unwrap ( ) . update ( config) ;
314
- }
312
+ let needs_inference = {
313
+ let mut config = self . config . lock ( ) . unwrap ( ) ;
314
+
315
+ if let Some ( init_config) = init_options. settings . map ( |s| s. rust ) {
316
+ config. update ( init_config) ;
317
+ }
318
+ config. needs_inference ( )
319
+ } ;
315
320
316
- if self . config . lock ( ) . unwrap ( ) . needs_inference ( ) {
321
+ if needs_inference {
317
322
let config = Arc :: clone ( & self . config ) ;
318
323
// Spawn another thread since we're shelling out to Cargo and this can
319
324
// cause a non-trivial amount of time due to disk access
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ fn initialize_with_opts(
42
42
root_path : Option < String > ,
43
43
initialization_options : Option < serde_json:: Value > ,
44
44
) -> Request < ls_server:: InitializeRequest > {
45
- // let init_opts = initialization_options.map(|val| serde_json::to_value(val).unwrap());
46
45
let params = InitializeParams {
47
46
process_id : None ,
48
47
root_path,
You can’t perform that action at this time.
0 commit comments