@@ -178,26 +178,15 @@ impl GlobalState {
178178 }
179179
180180 if !self . workspaces . is_empty ( ) {
181+ self . check_workspaces_msrv ( ) . for_each ( |e| {
182+ status. health |= lsp_ext:: Health :: Warning ;
183+ format_to ! ( message, "{e}" ) ;
184+ } ) ;
185+
181186 let proc_macro_clients =
182187 self . proc_macro_clients . iter ( ) . map ( Some ) . chain ( iter:: repeat_with ( || None ) ) ;
183188
184189 for ( ws, proc_macro_client) in self . workspaces . iter ( ) . zip ( proc_macro_clients) {
185- if let Some ( toolchain) = & ws. toolchain {
186- if * toolchain < crate :: MINIMUM_SUPPORTED_TOOLCHAIN_VERSION {
187- status. health |= lsp_ext:: Health :: Warning ;
188- format_to ! (
189- message,
190- "Workspace `{}` is using an outdated toolchain version `{}` but \
191- rust-analyzer only supports `{}` and higher.\n \
192- Consider using the rust-analyzer rustup component for your toolchain or
193- upgrade your toolchain to a supported version.\n \n " ,
194- ws. manifest_or_root( ) ,
195- toolchain,
196- crate :: MINIMUM_SUPPORTED_TOOLCHAIN_VERSION ,
197- ) ;
198- }
199- }
200-
201190 if let ProjectWorkspaceKind :: Cargo { error : Some ( error) , .. }
202191 | ProjectWorkspaceKind :: DetachedFile {
203192 cargo : Some ( ( _, _, Some ( error) ) ) , ..
@@ -529,6 +518,11 @@ impl GlobalState {
529518 // we don't care about build-script results, they are stale.
530519 // FIXME: can we abort the build scripts here if they are already running?
531520 self . workspaces = Arc :: new ( workspaces) ;
521+ self . check_workspaces_msrv ( ) . for_each ( |message| {
522+ self . send_notification :: < lsp_types:: notification:: ShowMessage > (
523+ lsp_types:: ShowMessageParams { typ : lsp_types:: MessageType :: WARNING , message } ,
524+ ) ;
525+ } ) ;
532526
533527 if self . config . run_build_scripts ( None ) {
534528 self . build_deps_changed = false ;
0 commit comments