File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/tools/rust-analyzer/crates/rust-analyzer/src/handlers Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use std::{
66
77use ide_db:: base_db:: {
88 DbPanicContext ,
9- salsa:: { self , Cancelled } ,
9+ salsa:: { self , Cancelled , UnexpectedCycle } ,
1010} ;
1111use lsp_server:: { ExtractError , Response , ResponseError } ;
1212use serde:: { Serialize , de:: DeserializeOwned } ;
@@ -349,11 +349,14 @@ where
349349 let mut message = "request handler panicked" . to_owned ( ) ;
350350 if let Some ( panic_message) = panic_message {
351351 message. push_str ( ": " ) ;
352- message. push_str ( panic_message)
352+ message. push_str ( panic_message) ;
353+ } else if let Some ( cycle) = panic. downcast_ref :: < UnexpectedCycle > ( ) {
354+ tracing:: error!( "{cycle}" ) ;
355+ message. push_str ( ": unexpected cycle" ) ;
353356 } else if let Ok ( cancelled) = panic. downcast :: < Cancelled > ( ) {
354357 tracing:: error!( "Cancellation propagated out of salsa! This is a bug" ) ;
355358 return Err ( HandlerCancelledError :: Inner ( * cancelled) ) ;
356- }
359+ } ;
357360
358361 Ok ( lsp_server:: Response :: new_err (
359362 id,
You can’t perform that action at this time.
0 commit comments