Skip to content

Commit

Permalink
Fix rust-analyzer not enabling rust-analyzer spans on the proc-macro …
Browse files Browse the repository at this point in the history
…server
  • Loading branch information
Veykril committed Feb 22, 2024
1 parent cdfb73a commit efa6948
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/proc-macro-api/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl ProcMacroProcessSrv {
})
};
let mut srv = create_srv(true)?;
tracing::info!("sending version check");
tracing::info!("sending proc-macro server version check");
match srv.version_check() {
Ok(v) if v > CURRENT_API_VERSION => Err(io::Error::new(
io::ErrorKind::Other,
Expand All @@ -55,14 +55,15 @@ impl ProcMacroProcessSrv {
),
)),
Ok(v) => {
tracing::info!("got version {v}");
tracing::info!("Proc-macro server version: {v}");
srv = create_srv(false)?;
srv.version = v;
if srv.version > RUST_ANALYZER_SPAN_SUPPORT {
if srv.version >= RUST_ANALYZER_SPAN_SUPPORT {
if let Ok(mode) = srv.enable_rust_analyzer_spans() {
srv.mode = mode;
}
}
tracing::info!("Proc-macro server span mode: {:?}", srv.mode);
Ok(srv)
}
Err(e) => {
Expand Down

0 comments on commit efa6948

Please sign in to comment.