@@ -353,6 +353,7 @@ impl Registry {
353
353
pub fn restart (
354
354
& mut self ,
355
355
language_config : & LanguageConfiguration ,
356
+ doc_path : Option < & std:: path:: PathBuf > ,
356
357
) -> Result < Option < Arc < Client > > > {
357
358
let config = match & language_config. language_server {
358
359
Some ( config) => config,
@@ -367,7 +368,8 @@ impl Registry {
367
368
// initialize a new client
368
369
let id = self . counter . fetch_add ( 1 , Ordering :: Relaxed ) ;
369
370
370
- let NewClientResult ( client, incoming) = start_client ( id, language_config, config) ?;
371
+ let NewClientResult ( client, incoming) =
372
+ start_client ( id, language_config, config, doc_path) ?;
371
373
self . incoming . push ( UnboundedReceiverStream :: new ( incoming) ) ;
372
374
373
375
let ( _, old_client) = entry. insert ( ( id, client. clone ( ) ) ) ;
@@ -381,7 +383,11 @@ impl Registry {
381
383
}
382
384
}
383
385
384
- pub fn get ( & mut self , language_config : & LanguageConfiguration ) -> Result < Option < Arc < Client > > > {
386
+ pub fn get (
387
+ & mut self ,
388
+ language_config : & LanguageConfiguration ,
389
+ doc_path : Option < & std:: path:: PathBuf > ,
390
+ ) -> Result < Option < Arc < Client > > > {
385
391
let config = match & language_config. language_server {
386
392
Some ( config) => config,
387
393
None => return Ok ( None ) ,
@@ -393,7 +399,8 @@ impl Registry {
393
399
// initialize a new client
394
400
let id = self . counter . fetch_add ( 1 , Ordering :: Relaxed ) ;
395
401
396
- let NewClientResult ( client, incoming) = start_client ( id, language_config, config) ?;
402
+ let NewClientResult ( client, incoming) =
403
+ start_client ( id, language_config, config, doc_path) ?;
397
404
self . incoming . push ( UnboundedReceiverStream :: new ( incoming) ) ;
398
405
399
406
entry. insert ( ( id, client. clone ( ) ) ) ;
@@ -493,6 +500,7 @@ fn start_client(
493
500
id : usize ,
494
501
config : & LanguageConfiguration ,
495
502
ls_config : & LanguageServerConfiguration ,
503
+ doc_path : Option < & std:: path:: PathBuf > ,
496
504
) -> Result < NewClientResult > {
497
505
let ( client, incoming, initialize_notify) = Client :: start (
498
506
& ls_config. command ,
@@ -501,6 +509,7 @@ fn start_client(
501
509
& config. roots ,
502
510
id,
503
511
ls_config. timeout ,
512
+ doc_path,
504
513
) ?;
505
514
506
515
let client = Arc :: new ( client) ;
0 commit comments