Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/proc-macro-api/src/process.rs')
-rw-r--r--crates/proc-macro-api/src/process.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/crates/proc-macro-api/src/process.rs b/crates/proc-macro-api/src/process.rs
index 9f80880965..80e4ed05c3 100644
--- a/crates/proc-macro-api/src/process.rs
+++ b/crates/proc-macro-api/src/process.rs
@@ -18,7 +18,11 @@ use stdx::JodChild;
use crate::{
ProcMacro, ProcMacroKind, ProtocolFormat, ServerError,
- bidirectional_protocol::{self, SubCallback, msg::BidirectionalMessage, reject_subrequests},
+ bidirectional_protocol::{
+ self, SubCallback,
+ msg::{BidirectionalMessage, SubResponse},
+ reject_subrequests,
+ },
legacy_protocol::{self, SpanMode},
version,
};
@@ -207,14 +211,18 @@ impl ProcMacroServerProcess {
pub(crate) fn find_proc_macros(
&self,
dylib_path: &AbsPath,
- callback: Option<SubCallback<'_>>,
) -> Result<Result<Vec<(String, ProcMacroKind)>, String>, ServerError> {
match self.protocol {
Protocol::LegacyJson { .. } => legacy_protocol::find_proc_macros(self, dylib_path),
Protocol::BidirectionalPostcardPrototype { .. } => {
- let cb = callback.expect("callback required for bidirectional protocol");
- bidirectional_protocol::find_proc_macros(self, dylib_path, cb)
+ bidirectional_protocol::find_proc_macros(self, dylib_path, &|_| {
+ Ok(SubResponse::Cancel {
+ reason: String::from(
+ "Server should not do a sub request when loading proc-macros",
+ ),
+ })
+ })
}
}
}