@@ -90,38 +90,55 @@ impl GlobalState {
90
90
quiescent : self . is_quiescent ( ) ,
91
91
message : None ,
92
92
} ;
93
+ let mut message = String :: new ( ) ;
93
94
94
95
if self . proc_macro_changed {
95
96
status. health = lsp_ext:: Health :: Warning ;
96
- status. message =
97
- Some ( "Reload required due to source changes of a procedural macro." . into ( ) )
97
+ message. push_str ( "Reload required due to source changes of a procedural macro.\n \n " ) ;
98
98
}
99
99
if let Err ( _) = self . fetch_build_data_error ( ) {
100
100
status. health = lsp_ext:: Health :: Warning ;
101
- status. message =
102
- Some ( "Failed to run build scripts of some packages, check the logs." . to_string ( ) ) ;
101
+ message. push_str ( "Failed to run build scripts of some packages.\n \n " ) ;
103
102
}
104
103
if !self . config . cargo_autoreload ( )
105
104
&& self . is_quiescent ( )
106
105
&& self . fetch_workspaces_queue . op_requested ( )
107
106
{
108
107
status. health = lsp_ext:: Health :: Warning ;
109
- status . message = Some ( "Workspace reload required" . to_string ( ) )
108
+ message. push_str ( "Auto-reloading is disabled and the workspace has changed, a manual workspace reload is required. \n \n " ) ;
110
109
}
111
-
112
- if let Err ( _) = self . fetch_workspace_error ( ) {
113
- status. health = lsp_ext:: Health :: Error ;
114
- status. message = Some ( "Failed to load workspaces" . to_string ( ) )
115
- }
116
-
117
110
if self . config . linked_projects ( ) . is_empty ( )
118
111
&& self . config . detached_files ( ) . is_empty ( )
119
112
&& self . config . notifications ( ) . cargo_toml_not_found
120
113
{
121
114
status. health = lsp_ext:: Health :: Warning ;
122
- status. message = Some ( "Failed to discover workspace" . to_string ( ) )
115
+ message. push_str ( "Failed to discover workspace.\n \n " ) ;
116
+ }
117
+
118
+ for ws in self . workspaces . iter ( ) {
119
+ let ( ProjectWorkspace :: Cargo { sysroot, .. }
120
+ | ProjectWorkspace :: Json { sysroot, .. }
121
+ | ProjectWorkspace :: DetachedFiles { sysroot, .. } ) = ws;
122
+ if let Err ( Some ( e) ) = sysroot {
123
+ status. health = lsp_ext:: Health :: Warning ;
124
+ message. push_str ( e) ;
125
+ message. push_str ( "\n \n " ) ;
126
+ }
127
+ if let ProjectWorkspace :: Cargo { rustc : Err ( Some ( e) ) , .. } = ws {
128
+ status. health = lsp_ext:: Health :: Warning ;
129
+ message. push_str ( e) ;
130
+ message. push_str ( "\n \n " ) ;
131
+ }
123
132
}
124
133
134
+ if let Err ( _) = self . fetch_workspace_error ( ) {
135
+ status. health = lsp_ext:: Health :: Error ;
136
+ message. push_str ( "Failed to load workspaces.\n \n " ) ;
137
+ }
138
+
139
+ if !message. is_empty ( ) {
140
+ status. message = Some ( message. trim_end ( ) . to_owned ( ) ) ;
141
+ }
125
142
status
126
143
}
127
144
0 commit comments