File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
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::{
6
6
7
7
use ide_db:: base_db:: {
8
8
DbPanicContext ,
9
- salsa:: { self , Cancelled } ,
9
+ salsa:: { self , Cancelled , UnexpectedCycle } ,
10
10
} ;
11
11
use lsp_server:: { ExtractError , Response , ResponseError } ;
12
12
use serde:: { Serialize , de:: DeserializeOwned } ;
@@ -349,11 +349,14 @@ where
349
349
let mut message = "request handler panicked" . to_owned ( ) ;
350
350
if let Some ( panic_message) = panic_message {
351
351
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" ) ;
353
356
} else if let Ok ( cancelled) = panic. downcast :: < Cancelled > ( ) {
354
357
tracing:: error!( "Cancellation propagated out of salsa! This is a bug" ) ;
355
358
return Err ( HandlerCancelledError :: Inner ( * cancelled) ) ;
356
- }
359
+ } ;
357
360
358
361
Ok ( lsp_server:: Response :: new_err (
359
362
id,
You can’t perform that action at this time.
0 commit comments