File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -635,12 +635,16 @@ fn on_check_task(
635635
636636 CheckTask :: AddDiagnostic { url, diagnostic, fixes } => {
637637 let path = url. to_file_path ( ) . map_err ( |( ) | format ! ( "invalid uri: {}" , url) ) ?;
638- let file_id = world_state
639- . vfs
640- . read ( )
641- . path2file ( & path)
642- . map ( |it| FileId ( it. 0 ) )
643- . ok_or_else ( || format ! ( "unknown file: {}" , path. to_string_lossy( ) ) ) ?;
638+ let file_id = match world_state. vfs . read ( ) . path2file ( & path) {
639+ Some ( file) => FileId ( file. 0 ) ,
640+ None => {
641+ log:: error!(
642+ "File with cargo diagnostic not found in VFS: {}" ,
643+ path. to_string_lossy( )
644+ ) ;
645+ return Ok ( ( ) ) ;
646+ }
647+ } ;
644648
645649 task_sender
646650 . send ( Task :: Diagnostic ( DiagnosticTask :: AddCheck ( file_id, diagnostic, fixes) ) ) ?;
You can’t perform that action at this time.
0 commit comments