Decouple proc-macro server protocol from the server implementation

This commit is contained in:
Lukas Wirth 2024-12-30 10:03:51 +01:00
parent 90b724afad
commit 714b81bec1
17 changed files with 242 additions and 217 deletions

View file

@ -358,6 +358,18 @@ impl HirFileId {
}
}
/// Legacy span type, only defined here as it is still used by the proc-macro server.
/// While rust-analyzer doesn't use this anymore at all, RustRover relies on the legacy type for
/// proc-macro expansion.
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub struct TokenId(pub u32);
impl std::fmt::Debug for TokenId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
#[cfg(not(feature = "ra-salsa"))]
mod intern_id_proxy {
use std::fmt;