@@ -80,7 +80,8 @@ impl GlobalState {
8080 & self . config . lru_query_capacities ( ) . cloned ( ) . unwrap_or_default ( ) ,
8181 ) ;
8282 }
83- if self . config . linked_projects ( ) != old_config. linked_projects ( ) {
83+ if self . config . linked_or_discovered_projects ( ) != old_config. linked_or_discovered_projects ( )
84+ {
8485 self . fetch_workspaces_queue . request_op ( "linked projects changed" . to_string ( ) , false )
8586 } else if self . config . flycheck ( ) != old_config. flycheck ( ) {
8687 self . reload_flycheck ( ) ;
@@ -128,7 +129,7 @@ impl GlobalState {
128129 status. health = lsp_ext:: Health :: Warning ;
129130 message. push_str ( "Auto-reloading is disabled and the workspace has changed, a manual workspace reload is required.\n \n " ) ;
130131 }
131- if self . config . linked_projects ( ) . is_empty ( )
132+ if self . config . linked_or_discovered_projects ( ) . is_empty ( )
132133 && self . config . detached_files ( ) . is_empty ( )
133134 && self . config . notifications ( ) . cargo_toml_not_found
134135 {
@@ -174,7 +175,21 @@ impl GlobalState {
174175
175176 if let Err ( _) = self . fetch_workspace_error ( ) {
176177 status. health = lsp_ext:: Health :: Error ;
177- message. push_str ( "Failed to load workspaces.\n \n " ) ;
178+ message. push_str ( "Failed to load workspaces." ) ;
179+
180+ if self . config . has_linked_projects ( ) {
181+ message. push_str (
182+ "`rust-analyzer.linkedProjects` have been specified, which may be incorrect. Specified project paths:\n " ,
183+ ) ;
184+ message. push_str ( & format ! (
185+ " {}" ,
186+ self . config. linked_manifests( ) . map( |it| it. display( ) ) . format( "\n " )
187+ ) ) ;
188+ if self . config . has_linked_project_jsons ( ) {
189+ message. push_str ( "\n Additionally, one or more project jsons are specified" )
190+ }
191+ }
192+ message. push_str ( "\n \n " ) ;
178193 }
179194
180195 if !message. is_empty ( ) {
@@ -187,7 +202,7 @@ impl GlobalState {
187202 tracing:: info!( %cause, "will fetch workspaces" ) ;
188203
189204 self . task_pool . handle . spawn_with_sender ( ThreadIntent :: Worker , {
190- let linked_projects = self . config . linked_projects ( ) ;
205+ let linked_projects = self . config . linked_or_discovered_projects ( ) ;
191206 let detached_files = self . config . detached_files ( ) . to_vec ( ) ;
192207 let cargo_config = self . config . cargo ( ) ;
193208
0 commit comments