Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/proc-macro-srv-cli/src/main_loop.rs')
| -rw-r--r-- | crates/proc-macro-srv-cli/src/main_loop.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/proc-macro-srv-cli/src/main_loop.rs b/crates/proc-macro-srv-cli/src/main_loop.rs index 869c5f9392..cae6d31f1a 100644 --- a/crates/proc-macro-srv-cli/src/main_loop.rs +++ b/crates/proc-macro-srv-cli/src/main_loop.rs @@ -7,10 +7,11 @@ use std::{ io::{self, BufRead, Write}, ops::Range, }; +use std::panic::panic_any; use legacy::Message; -use proc_macro_srv::{EnvSnapshot, ProcMacroClientError, SpanId}; +use proc_macro_srv::{EnvSnapshot, ProcMacroCancelMarker, ProcMacroClientError, SpanId}; struct SpanTrans; @@ -201,7 +202,7 @@ impl proc_macro_srv::ProcMacroClientInterface for ProcMacroClientHandle<'_> { match self.roundtrip(bidirectional::SubRequest::FilePath { file_id: file_id.index() }) { Ok(bidirectional::SubResponse::FilePathResult { name }) => name, Err(ProcMacroClientError::Cancelled { reason }) => { - panic!("proc-macro expansion cancelled by client: {reason}"); + panic_any(ProcMacroCancelMarker { reason }); } Err(err) => { panic!("proc-macro IPC failed: {err:?}"); @@ -224,7 +225,7 @@ impl proc_macro_srv::ProcMacroClientInterface for ProcMacroClientHandle<'_> { }) { Ok(bidirectional::SubResponse::SourceTextResult { text }) => text, Err(ProcMacroClientError::Cancelled { reason }) => { - panic!("proc-macro expansion cancelled by client: {reason}"); + panic_any(ProcMacroCancelMarker { reason }); } Err(err) => { panic!("proc-macro IPC failed: {err:?}"); @@ -240,7 +241,7 @@ impl proc_macro_srv::ProcMacroClientInterface for ProcMacroClientHandle<'_> { { Ok(bidirectional::SubResponse::LocalFilePathResult { name }) => name, Err(ProcMacroClientError::Cancelled { reason }) => { - panic!("proc-macro expansion cancelled by client: {reason}"); + panic_any(ProcMacroCancelMarker { reason }); } Err(err) => { panic!("proc-macro IPC failed: {err:?}"); @@ -262,7 +263,7 @@ impl proc_macro_srv::ProcMacroClientInterface for ProcMacroClientHandle<'_> { Some((line, column)) } Err(ProcMacroClientError::Cancelled { reason }) => { - panic!("proc-macro expansion cancelled by client: {reason}"); + panic_any(ProcMacroCancelMarker { reason }); } Err(err) => { panic!("proc-macro IPC failed: {err:?}"); |