Type Alias 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<SN: Borrow<SyntaxNode>> InFile<SN>

source

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

source

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

source

pub fn kind(&self) -> SyntaxKind

source

pub fn text_range(&self) -> TextRange

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_syntax_node_rooted( self, db: &dyn ExpandDatabase, ) -> Option<InRealFile<SyntaxNode>>

source§

impl InFile<&SyntaxNode>

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§

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>

source§

impl<T> InFile<T>

Trait Implementations§

source§

impl<T> From<InFileWrapper<EditionedFileId, 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.