This repository was archived by the owner on Dec 29, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -262,8 +262,8 @@ impl InitActionContext {
262
262
}
263
263
264
264
fn check_change_version ( & self , file_path : & Path , version_num : u64 ) {
265
- let mut prev_changes = self . prev_changes . lock ( ) . unwrap ( ) ;
266
265
let file_path = file_path. to_owned ( ) ;
266
+ let mut prev_changes = self . prev_changes . lock ( ) . unwrap ( ) ;
267
267
268
268
if prev_changes. contains_key ( & file_path) {
269
269
let prev_version = prev_changes[ & file_path] ;
@@ -273,6 +273,12 @@ impl InitActionContext {
273
273
prev_changes. insert ( file_path, version_num) ;
274
274
}
275
275
276
+ fn reset_change_version ( & self , file_path : & Path ) {
277
+ let file_path = file_path. to_owned ( ) ;
278
+ let mut prev_changes = self . prev_changes . lock ( ) . unwrap ( ) ;
279
+ prev_changes. remove ( & file_path) ;
280
+ }
281
+
276
282
fn convert_pos_to_span ( & self , file_path : PathBuf , pos : Position ) -> Span {
277
283
trace ! ( "convert_pos_to_span: {:?} {:?}" , file_path, pos) ;
278
284
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ impl BlockingNotificationAction for DidOpenTextDocument {
69
69
trace ! ( "on_open: {:?}" , params. text_document. uri) ;
70
70
let ctx = ctx. inited ( ) ;
71
71
let file_path = parse_file_path ! ( & params. text_document. uri, "on_open" ) ?;
72
-
72
+ ctx . reset_change_version ( & file_path ) ;
73
73
ctx. vfs . set_file ( & file_path, & params. text_document . text ) ;
74
74
Ok ( ( ) )
75
75
}
You can’t perform that action at this time.
0 commit comments