@@ -166,9 +166,9 @@ impl GlobalState {
166
166
} ) ;
167
167
}
168
168
169
- pub ( crate ) fn switch_workspaces ( & mut self ) {
169
+ pub ( crate ) fn switch_workspaces ( & mut self , cause : Cause ) {
170
170
let _p = profile:: span ( "GlobalState::switch_workspaces" ) ;
171
- tracing:: info!( "will switch workspaces" ) ;
171
+ tracing:: info!( %cause , "will switch workspaces" ) ;
172
172
173
173
if let Err ( error_message) = self . fetch_workspace_error ( ) {
174
174
self . show_and_log_error ( error_message, None ) ;
@@ -224,6 +224,8 @@ impl GlobalState {
224
224
if same_workspaces {
225
225
let ( workspaces, build_scripts) = self . fetch_build_data_queue . last_op_result ( ) ;
226
226
if Arc :: ptr_eq ( workspaces, & self . workspaces ) {
227
+ tracing:: debug!( "set build scripts to workspaces" ) ;
228
+
227
229
let workspaces = workspaces
228
230
. iter ( )
229
231
. cloned ( )
@@ -237,11 +239,14 @@ impl GlobalState {
237
239
// Workspaces are the same, but we've updated build data.
238
240
self . workspaces = Arc :: new ( workspaces) ;
239
241
} else {
242
+ tracing:: info!( "build scrips do not match the version of the active workspace" ) ;
240
243
// Current build scripts do not match the version of the active
241
244
// workspace, so there's nothing for us to update.
242
245
return ;
243
246
}
244
247
} else {
248
+ tracing:: debug!( "abandon build scripts for workspaces" ) ;
249
+
245
250
// Here, we completely changed the workspace (Cargo.toml edit), so
246
251
// we don't care about build-script results, they are stale.
247
252
self . workspaces = Arc :: new ( workspaces)
0 commit comments