@@ -296,10 +296,6 @@ impl Lsp {
296296 self . ready . load ( Ordering :: SeqCst )
297297 }
298298
299- pub fn lsp_name ( & self ) -> Option < & str > {
300- self . lsp_name . as_deref ( )
301- }
302-
303299 pub fn initialized ( & mut self ) {
304300 let params = InitializedParams { } ;
305301 self . send_notification :: < Initialized > ( params) ;
@@ -361,39 +357,14 @@ impl Lsp {
361357 }
362358
363359 pub async fn did_change (
364- & mut self ,
365- start_line : usize ,
366- start_column : usize ,
367- end_line : usize ,
368- end_column : usize ,
369- path : & str ,
370- text : & str ,
371- ) -> Result < ( ) > {
372- self . did_change_multi (
373- path,
374- vec ! [ TextDocumentContentChangeEvent {
375- range: Some ( Range {
376- start: Position :: new( start_line as u32 , start_column as u32 ) ,
377- end: Position :: new( end_line as u32 , end_column as u32 ) ,
378- } ) ,
379- range_length: None ,
380- text: text. to_string( ) ,
381- } ] ,
382- )
383- . await
384- }
385-
386- pub async fn did_change_multi (
387360 & mut self ,
388361 path : & str ,
389362 content_changes : Vec < TextDocumentContentChangeEvent > ,
390363 ) -> Result < ( ) > {
391364 let uri = path_to_uri ( path) ?;
365+ let version = self . get_next_version ( path) as i32 ;
392366 let params = DidChangeTextDocumentParams {
393- text_document : VersionedTextDocumentIdentifier {
394- uri,
395- version : self . get_next_version ( path) as i32 ,
396- } ,
367+ text_document : VersionedTextDocumentIdentifier { uri, version } ,
397368 content_changes,
398369 } ;
399370
@@ -576,7 +547,7 @@ mod tests {
576547 assert ! ( references_str. contains( "fast.py" ) ) ;
577548 assert ! ( references_str. contains( "Position { line: 0, character: 30 }" ) ) ;
578549
579- lsp. stop ( ) . await ;
550+ let _ = lsp. stop ( ) . await ;
580551 Ok ( ( ) )
581552 }
582553}
@@ -589,8 +560,6 @@ pub mod lsp_messages {
589560
590561 #[ derive( Deserialize ) ]
591562 pub struct LspRawResponse {
592- pub jsonrpc : String ,
593- pub id : Value ,
594563 pub result : Option < Value > ,
595564 pub error : Option < Value > ,
596565 }
@@ -723,6 +692,7 @@ pub mod lsp_messages {
723692 None
724693 } ;
725694
695+ #[ allow( deprecated) ]
726696 let params = InitializeParams {
727697 process_id : Some ( std:: process:: id ( ) as u32 ) ,
728698 root_path : Some ( dir. to_string ( ) ) ,
@@ -813,26 +783,6 @@ impl LspManager {
813783 self . lang2lsp . insert ( lang, lsp) ;
814784 }
815785
816- pub fn notify_configuration_changed ( & mut self , lang : & str , dir : & str ) {
817- if let Some ( lsp) = self . lang2lsp . get_mut ( lang) {
818- if let Some ( lsp_name) = lsp. lsp_name ( ) {
819- if let Some ( settings) = lsp_messages:: read_vscode_settings ( lsp_name, dir) {
820- lsp. did_change_configuration ( settings) ;
821- }
822- }
823- }
824- }
825-
826- pub fn notify_all_configuration_changed ( & mut self , dir : & str ) {
827- for lsp in self . lang2lsp . values_mut ( ) {
828- if let Some ( lsp_name) = lsp. lsp_name ( ) {
829- if let Some ( settings) = lsp_messages:: read_vscode_settings ( lsp_name, dir) {
830- lsp. did_change_configuration ( settings) ;
831- }
832- }
833- }
834- }
835-
836786 pub async fn stop ( & mut self , lang : & str ) {
837787 if let Some ( mut lsp) = self . lang2lsp . remove ( lang) {
838788 let _ = lsp. stop ( ) . await ;
0 commit comments