mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 19:17:12 +00:00
Support spans with proc macro servers from before the ast id changes
The only thing changed is the value of the fixup ast id, so we just swap it.
This commit is contained in:
parent
c15fc9a344
commit
3e834add61
10 changed files with 96 additions and 102 deletions
|
|
@ -108,7 +108,8 @@ impl fmt::Debug for ErasedFileAstId {
|
|||
|
||||
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
|
||||
enum ErasedFileAstIdKind {
|
||||
Root,
|
||||
/// This needs to not change because it's depended upon by the proc macro server.
|
||||
Fixup,
|
||||
// The following are associated with `ErasedHasNameFileAstId`.
|
||||
Enum,
|
||||
Struct,
|
||||
|
|
@ -143,7 +144,7 @@ enum ErasedFileAstIdKind {
|
|||
/// Associated with [`BlockExprFileAstId`].
|
||||
BlockExpr,
|
||||
/// Keep this last.
|
||||
Fixup,
|
||||
Root,
|
||||
}
|
||||
|
||||
// First hash, then index, then kind.
|
||||
|
|
@ -218,7 +219,7 @@ impl ErasedFileAstId {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_raw(v: u32) -> Self {
|
||||
pub const fn from_raw(v: u32) -> Self {
|
||||
Self(v)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue