File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,14 @@ impl GlobalState {
106
106
status. health = lsp_ext:: Health :: Error ;
107
107
status. message = Some ( error)
108
108
}
109
+
110
+ if self . config . linked_projects ( ) . is_empty ( )
111
+ && self . config . detached_files ( ) . is_empty ( )
112
+ && self . config . notifications ( ) . cargo_toml_not_found
113
+ {
114
+ status. health = lsp_ext:: Health :: Warning ;
115
+ status. message = Some ( "Workspace reload required" . to_string ( ) )
116
+ }
109
117
status
110
118
}
111
119
@@ -427,9 +435,14 @@ impl GlobalState {
427
435
fn fetch_workspace_error ( & self ) -> Result < ( ) , String > {
428
436
let mut buf = String :: new ( ) ;
429
437
430
- for ws in self . fetch_workspaces_queue . last_op_result ( ) {
431
- if let Err ( err) = ws {
432
- stdx:: format_to!( buf, "rust-analyzer failed to load workspace: {:#}\n " , err) ;
438
+ let last_op_result = self . fetch_workspaces_queue . last_op_result ( ) ;
439
+ if last_op_result. is_empty ( ) {
440
+ stdx:: format_to!( buf, "rust-analyzer failed to discover workspace" ) ;
441
+ } else {
442
+ for ws in last_op_result {
443
+ if let Err ( err) = ws {
444
+ stdx:: format_to!( buf, "rust-analyzer failed to load workspace: {:#}\n " , err) ;
445
+ }
433
446
}
434
447
}
435
448
You can’t perform that action at this time.
0 commit comments