File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ pub(crate) struct GlobalState {
100
100
/// the user just adds comments or whitespace to Cargo.toml, we do not want
101
101
/// to invalidate any salsa caches.
102
102
pub ( crate ) workspaces : Arc < Vec < ProjectWorkspace > > ,
103
- pub ( crate ) fetch_workspaces_queue : OpQueue < Vec < anyhow:: Result < ProjectWorkspace > > > ,
103
+ pub ( crate ) fetch_workspaces_queue : OpQueue < Option < Vec < anyhow:: Result < ProjectWorkspace > > > > ,
104
104
pub ( crate ) fetch_build_data_queue :
105
105
OpQueue < ( Arc < Vec < ProjectWorkspace > > , Vec < anyhow:: Result < WorkspaceBuildScripts > > ) > ,
106
106
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ impl GlobalState {
451
451
ProjectWorkspaceProgress :: Begin => ( Progress :: Begin , None ) ,
452
452
ProjectWorkspaceProgress :: Report ( msg) => ( Progress :: Report , Some ( msg) ) ,
453
453
ProjectWorkspaceProgress :: End ( workspaces) => {
454
- self . fetch_workspaces_queue . op_completed ( workspaces) ;
454
+ self . fetch_workspaces_queue . op_completed ( Some ( workspaces) ) ;
455
455
456
456
let old = Arc :: clone ( & self . workspaces ) ;
457
457
self . switch_workspaces ( "fetched workspace" . to_string ( ) ) ;
Original file line number Diff line number Diff line change @@ -206,12 +206,9 @@ impl GlobalState {
206
206
self . show_and_log_error ( "failed to run build scripts" . to_string ( ) , Some ( error) ) ;
207
207
}
208
208
209
- let workspaces = self
210
- . fetch_workspaces_queue
211
- . last_op_result ( )
212
- . iter ( )
213
- . filter_map ( |res| res. as_ref ( ) . ok ( ) . cloned ( ) )
214
- . collect :: < Vec < _ > > ( ) ;
209
+ let Some ( workspaces) = self . fetch_workspaces_queue . last_op_result ( ) else { return ; } ;
210
+ let workspaces =
211
+ workspaces. iter ( ) . filter_map ( |res| res. as_ref ( ) . ok ( ) . cloned ( ) ) . collect :: < Vec < _ > > ( ) ;
215
212
216
213
fn eq_ignore_build_data < ' a > (
217
214
left : & ' a ProjectWorkspace ,
@@ -435,7 +432,7 @@ impl GlobalState {
435
432
fn fetch_workspace_error ( & self ) -> Result < ( ) , String > {
436
433
let mut buf = String :: new ( ) ;
437
434
438
- let last_op_result = self . fetch_workspaces_queue . last_op_result ( ) ;
435
+ let Some ( last_op_result) = self . fetch_workspaces_queue . last_op_result ( ) else { return Ok ( ( ) ) } ;
439
436
if last_op_result. is_empty ( ) {
440
437
stdx:: format_to!( buf, "rust-analyzer failed to discover workspace" ) ;
441
438
} else {
You can’t perform that action at this time.
0 commit comments