Move AstIdMap infra to the span crate

This commit is contained in:
Lukas Wirth 2024-03-01 15:39:44 +01:00
parent 549aae7c07
commit efd76ecff1
14 changed files with 61 additions and 73 deletions

View file

@ -3,10 +3,12 @@ use std::fmt::{self, Write};
use salsa::InternId;
mod ast_id;
mod hygiene;
mod map;
pub use self::{
ast_id::{AstIdMap, AstIdNode, ErasedFileAstId, FileAstId},
hygiene::{SyntaxContextData, SyntaxContextId, Transparency},
map::{RealSpanMap, SpanMap},
};
@ -26,10 +28,6 @@ pub struct FileRange {
pub range: TextRange,
}
/// See crates\hir-expand\src\ast_id_map.rs
/// This is a type erased FileAstId.
pub type ErasedFileAstId = la_arena::Idx<syntax::SyntaxNodePtr>;
// The first index is always the root node's AstId
/// The root ast id always points to the encompassing file, using this in spans is discouraged as
/// any range relative to it will be effectively absolute, ruining the entire point of anchored