@@ -665,11 +665,11 @@ impl GlobalState {
665
665
} ) ?
666
666
. on :: < lsp_types:: notification:: DidOpenTextDocument > ( |this, params| {
667
667
if let Ok ( path) = from_proto:: vfs_path ( & params. text_document . uri ) {
668
- if this
668
+ let already_exists = this
669
669
. mem_docs
670
670
. insert ( path. clone ( ) , DocumentData :: new ( params. text_document . version ) )
671
- . is_err ( )
672
- {
671
+ . is_err ( ) ;
672
+ if already_exists {
673
673
tracing:: error!( "duplicate DidOpenTextDocument: {}" , path)
674
674
}
675
675
this. vfs
@@ -688,7 +688,7 @@ impl GlobalState {
688
688
doc. version = params. text_document . version ;
689
689
}
690
690
None => {
691
- tracing:: error!( "unexpected DidChangeTextDocument: {}; send DidOpenTextDocument first " , path) ;
691
+ tracing:: error!( "unexpected DidChangeTextDocument: {}" , path) ;
692
692
return Ok ( ( ) ) ;
693
693
}
694
694
} ;
@@ -722,7 +722,8 @@ impl GlobalState {
722
722
}
723
723
if let Ok ( abs_path) = from_proto:: abs_path ( & params. text_document . uri ) {
724
724
if reload:: should_refresh_for_change ( & abs_path, ChangeKind :: Modify ) {
725
- this. fetch_workspaces_queue . request_op ( format ! ( "DidSaveTextDocument {}" , abs_path. display( ) ) ) ;
725
+ this. fetch_workspaces_queue
726
+ . request_op ( format ! ( "DidSaveTextDocument {}" , abs_path. display( ) ) ) ;
726
727
}
727
728
}
728
729
Ok ( ( ) )
@@ -751,7 +752,10 @@ impl GlobalState {
751
752
// provide a configuration. This is handled in Config::update below.
752
753
let mut config = Config :: clone ( & * this. config ) ;
753
754
if let Err ( error) = config. update ( json. take ( ) ) {
754
- this. show_message ( lsp_types:: MessageType :: WARNING , error. to_string ( ) ) ;
755
+ this. show_message (
756
+ lsp_types:: MessageType :: WARNING ,
757
+ error. to_string ( ) ,
758
+ ) ;
755
759
}
756
760
this. update_configuration ( config) ;
757
761
}
0 commit comments