Expand description
File and span related types.
Structs§
- AstIdMap 
- Maps items’ SyntaxNodes toErasedFileAstIds and back.
- EditionedFile Id 
- A FileIdandEditionbundled up together. The MSB is reserved forHirFileIdencoding, more upper bits are used to then encode the edition.
- ErasedFile AstId 
- This is a type erased FileAstId.
- FileAstId 
- AstIdpoints to an AST node in a specific file.
- FileId
- Handle to a file in Vfs
- HirFileId 
- Input to the analyzer is a set of files, where each file is identified by
FileIdand contains source code. However, another source of source code in Rust are macros: each macro can be thought of as producing a “temporary file”. To assign an id to such a file, we use the id of the macro call that produced the file. So, aHirFileIdis either aFileId(source code written by user), or aMacroCallId(source code produced by macro).
- MacroCall Id 
- MacroCallIdidentifies a particular macro invocation, like- println!("Hello, {}", world).
- RealSpan Map 
- SpanAnchor 
- SpanData 
- Spans represent a region of code, used by the IDE to be able link macro inputs and outputs
together. Positions in spans are relative to some SpanAnchorto make them more incremental friendly.
- SpanMap
- Maps absolute text ranges for the corresponding file to the relevant span data.
- SyntaxContext 
- A syntax context describes a hierarchy tracking order of macro definitions.
- TextRange 
- A range in text, represented as a pair of TextSize.
- TextSize 
- A measure of text length. Also, equivalently, an index into text.
Enums§
- Edition
- Transparency
- A property of a macro expansion that determines how identifiers produced by that expansion are resolved.
Constants§
- FIXUP_ERASED_ FILE_ AST_ ID_ MARKER 
- ErasedFileAstId used as the span for syntax node fixups. Any Span containing this file id is to be considered fake.
- ROOT_ERASED_ FILE_ AST_ ID 
- 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 relative text ranges.