@@ -218,7 +218,7 @@ impl GlobalState {
218
218
let _p = profile:: span ( "GlobalState::process_changes" ) ;
219
219
220
220
let mut file_changes = FxHashMap :: < _ , ( bool , ChangedFile ) > :: default ( ) ;
221
- let ( change, modified_files , workspace_structure_change) = {
221
+ let ( change, modified_rust_files , workspace_structure_change) = {
222
222
let mut change = Change :: new ( ) ;
223
223
let mut guard = self . vfs . write ( ) ;
224
224
let changed_files = guard. 0 . take_changes ( ) ;
@@ -254,8 +254,8 @@ impl GlobalState {
254
254
* change = Create ( new) ;
255
255
* just_created = true ;
256
256
}
257
- // shouldn't occur, but collapse into `Modify`
258
- ( Modify ( prev ) , _, Create ( new ) ) => * prev = new,
257
+ // shouldn't occur, but keep the Create
258
+ ( prev @ Modify ( _ ) , _, new @ Create ( _ ) ) => * prev = new,
259
259
}
260
260
}
261
261
Entry :: Vacant ( v) => {
@@ -276,7 +276,7 @@ impl GlobalState {
276
276
// A file was added or deleted
277
277
let mut has_structure_changes = false ;
278
278
let mut bytes = vec ! [ ] ;
279
- let mut modified_files = vec ! [ ] ;
279
+ let mut modified_rust_files = vec ! [ ] ;
280
280
for file in changed_files {
281
281
let vfs_path = & vfs. file_path ( file. file_id ) ;
282
282
if let Some ( path) = vfs_path. as_path ( ) {
@@ -288,8 +288,8 @@ impl GlobalState {
288
288
has_structure_changes = true ;
289
289
workspace_structure_change =
290
290
Some ( ( path, self . crate_graph_file_dependencies . contains ( vfs_path) ) ) ;
291
- } else {
292
- modified_files . push ( file. file_id ) ;
291
+ } else if path . extension ( ) == Some ( "rs" . as_ref ( ) ) {
292
+ modified_rust_files . push ( file. file_id ) ;
293
293
}
294
294
}
295
295
@@ -324,7 +324,7 @@ impl GlobalState {
324
324
let roots = self . source_root_config . partition ( vfs) ;
325
325
change. set_roots ( roots) ;
326
326
}
327
- ( change, modified_files , workspace_structure_change)
327
+ ( change, modified_rust_files , workspace_structure_change)
328
328
} ;
329
329
330
330
self . analysis_host . apply_change ( change) ;
@@ -339,7 +339,7 @@ impl GlobalState {
339
339
force_crate_graph_reload,
340
340
) ;
341
341
}
342
- self . proc_macro_changed = modified_files . into_iter ( ) . any ( |file_id| {
342
+ self . proc_macro_changed = modified_rust_files . into_iter ( ) . any ( |file_id| {
343
343
let crates = raw_database. relevant_crates ( file_id) ;
344
344
let crate_graph = raw_database. crate_graph ( ) ;
345
345
0 commit comments