@@ -80,7 +80,8 @@ impl GlobalState {
80
80
& self . config . lru_query_capacities ( ) . cloned ( ) . unwrap_or_default ( ) ,
81
81
) ;
82
82
}
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
+ {
84
85
self . fetch_workspaces_queue . request_op ( "linked projects changed" . to_string ( ) , false )
85
86
} else if self . config . flycheck ( ) != old_config. flycheck ( ) {
86
87
self . reload_flycheck ( ) ;
@@ -128,7 +129,7 @@ impl GlobalState {
128
129
status. health = lsp_ext:: Health :: Warning ;
129
130
message. push_str ( "Auto-reloading is disabled and the workspace has changed, a manual workspace reload is required.\n \n " ) ;
130
131
}
131
- if self . config . linked_projects ( ) . is_empty ( )
132
+ if self . config . linked_or_discovered_projects ( ) . is_empty ( )
132
133
&& self . config . detached_files ( ) . is_empty ( )
133
134
&& self . config . notifications ( ) . cargo_toml_not_found
134
135
{
@@ -174,7 +175,21 @@ impl GlobalState {
174
175
175
176
if let Err ( _) = self . fetch_workspace_error ( ) {
176
177
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 " ) ;
178
193
}
179
194
180
195
if !message. is_empty ( ) {
@@ -187,7 +202,7 @@ impl GlobalState {
187
202
tracing:: info!( %cause, "will fetch workspaces" ) ;
188
203
189
204
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 ( ) ;
191
206
let detached_files = self . config . detached_files ( ) . to_vec ( ) ;
192
207
let cargo_config = self . config . cargo ( ) ;
193
208
0 commit comments