mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Special case fixup spans in server::Span impl, they are immutable
This commit is contained in:
parent
2e52aa1615
commit
9e8e124269
6 changed files with 67 additions and 38 deletions
|
@ -30,6 +30,13 @@ pub type ErasedFileAstId = la_arena::Idx<syntax::SyntaxNodePtr>;
|
|||
pub const ROOT_ERASED_FILE_AST_ID: ErasedFileAstId =
|
||||
la_arena::Idx::from_raw(la_arena::RawIdx::from_u32(0));
|
||||
|
||||
/// FileId used as the span for syntax node fixups. Any Span containing this file id is to be
|
||||
/// considered fake.
|
||||
pub const FIXUP_ERASED_FILE_AST_ID_MARKER: ErasedFileAstId =
|
||||
// we pick the second to last for this in case we every consider making this a NonMaxU32, this
|
||||
// is required to be stable for the proc-macro-server
|
||||
la_arena::Idx::from_raw(la_arena::RawIdx::from_u32(!0 - 1));
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||
pub struct SpanData<Ctx> {
|
||||
/// The text range of this span, relative to the anchor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue