@@ -647,6 +647,7 @@ impl Registry {
647
647
language_config : & LanguageConfiguration ,
648
648
doc_path : Option < & std:: path:: PathBuf > ,
649
649
root_dirs : & [ PathBuf ] ,
650
+ enable_snippets : bool ,
650
651
) -> Result < Option < Arc < Client > > > {
651
652
let config = match & language_config. language_server {
652
653
Some ( config) => config,
@@ -661,8 +662,14 @@ impl Registry {
661
662
// initialize a new client
662
663
let id = self . counter . fetch_add ( 1 , Ordering :: Relaxed ) ;
663
664
664
- let NewClientResult ( client, incoming) =
665
- start_client ( id, language_config, config, doc_path, root_dirs) ?;
665
+ let NewClientResult ( client, incoming) = start_client (
666
+ id,
667
+ language_config,
668
+ config,
669
+ doc_path,
670
+ root_dirs,
671
+ enable_snippets,
672
+ ) ?;
666
673
self . incoming . push ( UnboundedReceiverStream :: new ( incoming) ) ;
667
674
668
675
let old_clients = entry. insert ( vec ! [ ( id, client. clone( ) ) ] ) ;
@@ -695,6 +702,7 @@ impl Registry {
695
702
language_config : & LanguageConfiguration ,
696
703
doc_path : Option < & std:: path:: PathBuf > ,
697
704
root_dirs : & [ PathBuf ] ,
705
+ enable_snippets : bool ,
698
706
) -> Result < Option < Arc < Client > > > {
699
707
let config = match & language_config. language_server {
700
708
Some ( config) => config,
@@ -711,8 +719,14 @@ impl Registry {
711
719
// initialize a new client
712
720
let id = self . counter . fetch_add ( 1 , Ordering :: Relaxed ) ;
713
721
714
- let NewClientResult ( client, incoming) =
715
- start_client ( id, language_config, config, doc_path, root_dirs) ?;
722
+ let NewClientResult ( client, incoming) = start_client (
723
+ id,
724
+ language_config,
725
+ config,
726
+ doc_path,
727
+ root_dirs,
728
+ enable_snippets,
729
+ ) ?;
716
730
clients. push ( ( id, client. clone ( ) ) ) ;
717
731
self . incoming . push ( UnboundedReceiverStream :: new ( incoming) ) ;
718
732
Ok ( Some ( client) )
@@ -811,6 +825,7 @@ fn start_client(
811
825
ls_config : & LanguageServerConfiguration ,
812
826
doc_path : Option < & std:: path:: PathBuf > ,
813
827
root_dirs : & [ PathBuf ] ,
828
+ enable_snippets : bool ,
814
829
) -> Result < NewClientResult > {
815
830
let ( client, incoming, initialize_notify) = Client :: start (
816
831
& ls_config. command ,
@@ -834,7 +849,7 @@ fn start_client(
834
849
. capabilities
835
850
. get_or_try_init ( || {
836
851
_client
837
- . initialize ( )
852
+ . initialize ( enable_snippets )
838
853
. map_ok ( |response| response. capabilities )
839
854
} )
840
855
. await ;
0 commit comments