@@ -293,7 +293,6 @@ fn run_flycheck(state: &mut GlobalState, vfs_path: VfsPath) -> bool {
293
293
let file_id = state. vfs . read ( ) . 0 . file_id ( & vfs_path) ;
294
294
if let Some ( file_id) = file_id {
295
295
let world = state. snapshot ( ) ;
296
- let source_root_id = world. analysis . source_root_id ( file_id) . ok ( ) ;
297
296
let may_flycheck_workspace = state. config . flycheck_workspace ( None ) ;
298
297
let mut updated = false ;
299
298
let task = move || -> std:: result:: Result < ( ) , ide:: Cancelled > {
@@ -376,16 +375,17 @@ fn run_flycheck(state: &mut GlobalState, vfs_path: VfsPath) -> bool {
376
375
let saved_file = vfs_path. as_path ( ) . map ( |p| p. to_owned ( ) ) ;
377
376
378
377
// Find and trigger corresponding flychecks
379
- for flycheck in world. flycheck . iter ( ) {
378
+ ' flychecks : for flycheck in world. flycheck . iter ( ) {
380
379
for ( id, package) in workspace_ids. clone ( ) {
381
380
if id == flycheck. id ( ) {
382
381
updated = true ;
383
- match package. filter ( |_| !world. config . flycheck_workspace ( source_root_id) ) {
384
- Some ( package) => flycheck
385
- . restart_for_package ( package, target. clone ( ) . map ( TupleExt :: head) ) ,
386
- None => flycheck. restart_workspace ( saved_file. clone ( ) ) ,
382
+ if may_flycheck_workspace {
383
+ flycheck. restart_workspace ( saved_file. clone ( ) )
384
+ } else if let Some ( package) = package {
385
+ flycheck
386
+ . restart_for_package ( package, target. clone ( ) . map ( TupleExt :: head) )
387
387
}
388
- continue ;
388
+ continue ' flychecks ;
389
389
}
390
390
}
391
391
}
0 commit comments