@@ -178,26 +178,15 @@ impl GlobalState {
178
178
}
179
179
180
180
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
+
181
186
let proc_macro_clients =
182
187
self . proc_macro_clients . iter ( ) . map ( Some ) . chain ( iter:: repeat_with ( || None ) ) ;
183
188
184
189
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
-
201
190
if let ProjectWorkspaceKind :: Cargo { error : Some ( error) , .. }
202
191
| ProjectWorkspaceKind :: DetachedFile {
203
192
cargo : Some ( ( _, _, Some ( error) ) ) , ..
@@ -529,6 +518,11 @@ impl GlobalState {
529
518
// we don't care about build-script results, they are stale.
530
519
// FIXME: can we abort the build scripts here if they are already running?
531
520
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
+ } ) ;
532
526
533
527
if self . config . run_build_scripts ( None ) {
534
528
self . build_deps_changed = false ;
0 commit comments