File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,14 @@ pub struct FileRange {
26
26
pub range : TextRange ,
27
27
}
28
28
29
+ /// See crates\hir-expand\src\ast_id_map.rs
30
+ /// This is a type erased FileAstId.
29
31
pub type ErasedFileAstId = la_arena:: Idx < syntax:: SyntaxNodePtr > ;
30
32
31
33
// The first index is always the root node's AstId
34
+ /// The root ast id always points to the encompassing file, using this in spans is discouraged as
35
+ /// any range relative to it will be effectively absolute, ruining the entire point of anchored
36
+ /// relative text ranges.
32
37
pub const ROOT_ERASED_FILE_AST_ID : ErasedFileAstId =
33
38
la_arena:: Idx :: from_raw ( la_arena:: RawIdx :: from_u32 ( 0 ) ) ;
34
39
@@ -47,6 +52,7 @@ pub struct SpanData<Ctx> {
47
52
/// We need the anchor for incrementality, as storing absolute ranges will require
48
53
/// recomputation on every change in a file at all times.
49
54
pub range : TextRange ,
55
+ /// The anchor this span is relative to.
50
56
pub anchor : SpanAnchor ,
51
57
/// The syntax context of the span.
52
58
pub ctx : Ctx ,
You can’t perform that action at this time.
0 commit comments