File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,14 @@ impl GlobalState {
106106 status. health = lsp_ext:: Health :: Error ;
107107 status. message = Some ( error)
108108 }
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+ }
109117 status
110118 }
111119
@@ -427,9 +435,14 @@ impl GlobalState {
427435 fn fetch_workspace_error ( & self ) -> Result < ( ) , String > {
428436 let mut buf = String :: new ( ) ;
429437
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+ }
433446 }
434447 }
435448
You can’t perform that action at this time.
0 commit comments