Type Alias ra_ap_hir_expand::files::InFile

source ·
pub type InFile<T> = InFileWrapper<HirFileId, T>;

Aliased Type§

struct InFile<T> {
    pub file_id: HirFileId,
    pub value: T,
}

Fields§

§file_id: HirFileId§value: T

Implementations§

source§

impl InFile<&SyntaxNode>

source

pub fn ancestors_with_macros_skip_attr_item( self, db: &dyn ExpandDatabase ) -> impl Iterator<Item = InFile<SyntaxNode>> + '_

Skips the attributed item that caused the macro invocation we are climbing up

source

pub fn original_file_range_rooted(self, db: &dyn ExpandDatabase) -> FileRange

Falls back to the macro call range if the node cannot be mapped up fully.

For attributes and derives, this will point back to the attribute only. For the entire item use [InFile::original_file_range_full].

source

pub fn original_file_range_with_macro_call_body( self, db: &dyn ExpandDatabase ) -> FileRange

Falls back to the macro call range if the node cannot be mapped up fully.

source

pub fn original_file_range_opt( self, db: &dyn ExpandDatabase ) -> Option<(FileRange, SyntaxContextId)>

Attempts to map the syntax node back up its macro calls.

source

pub fn original_syntax_node_rooted( self, db: &dyn ExpandDatabase ) -> Option<InRealFile<SyntaxNode>>

source§

impl InFile<SyntaxToken>

source

pub fn original_file_range(self, db: &dyn ExpandDatabase) -> FileRange

Falls back to the macro call range if the node cannot be mapped up fully.

source

pub fn original_file_range_opt( self, db: &dyn ExpandDatabase ) -> Option<FileRange>

Attempts to map the syntax node back up its macro calls.

source§

impl InFile<TextRange>

source§

impl<N: AstNode> InFile<N>

Trait Implementations§

source§

impl<T> From<InFileWrapper<FileId, T>> for InFile<T>

source§

fn from(_: InRealFile<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<InFileWrapper<MacroFileId, T>> for InFile<T>

source§

fn from(_: InMacroFile<T>) -> Self

Converts to this type from the input type.