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.rs29
1 files changed, 23 insertions, 6 deletions
diff --git a/crates/proc-macro-api/src/process.rs b/crates/proc-macro-api/src/process.rs
index 4045e25fdf..b1e35b7a08 100644
--- a/crates/proc-macro-api/src/process.rs
+++ b/crates/proc-macro-api/src/process.rs
@@ -56,8 +56,25 @@ impl ProcMacroProcessSrv {
match srv.version_check() {
Ok(v) if v > CURRENT_API_VERSION => Err(io::Error::new(
io::ErrorKind::Other,
- format!( "The version of the proc-macro server ({v}) in your Rust toolchain is newer than the version supported by your rust-analyzer ({CURRENT_API_VERSION}).
- This will prevent proc-macro expansion from working. Please consider updating your rust-analyzer to ensure compatibility with your current toolchain."
+ format!(
+ "The version of the proc-macro server ({v}) in your Rust toolchain \
+ is newer than the version supported by your rust-analyzer ({CURRENT_API_VERSION}).
+\
+ This will prevent proc-macro expansion from working. \
+ Please consider updating your rust-analyzer to ensure compatibility with your \
+ current toolchain."
+ ),
+ )),
+ Ok(v) if v < RUST_ANALYZER_SPAN_SUPPORT => Err(io::Error::new(
+ io::ErrorKind::Other,
+ format!(
+ "The version of the proc-macro server ({v}) in your Rust toolchain \
+ is too old and no longer supported by your rust-analyzer which requires\
+ version {RUST_ANALYZER_SPAN_SUPPORT} or higher.
+\
+ This will prevent proc-macro expansion from working. \
+ Please consider updating your toolchain or downgrading your rust-analyzer \
+ to ensure compatibility with your current toolchain."
),
)),
Ok(v) => {
@@ -72,10 +89,10 @@ impl ProcMacroProcessSrv {
tracing::info!("Proc-macro server span mode: {:?}", srv.mode);
Ok(srv)
}
- Err(e) => {
- tracing::info!(%e, "proc-macro version check failed, restarting and assuming version 0");
- create_srv(false)
- }
+ Err(e) => Err(io::Error::new(
+ io::ErrorKind::Other,
+ format!("Failed to fetch proc-macro server version: {e}"),
+ )),
}
}