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>
impl InFile<&SyntaxNode>
sourcepub fn ancestors_with_macros_skip_attr_item(
self,
db: &dyn ExpandDatabase
) -> impl Iterator<Item = InFile<SyntaxNode>> + '_
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
sourcepub fn original_file_range_rooted(self, db: &dyn ExpandDatabase) -> FileRange
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
].
sourcepub fn original_file_range_with_macro_call_body(
self,
db: &dyn ExpandDatabase
) -> FileRange
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.
sourcepub fn original_file_range_opt(
self,
db: &dyn ExpandDatabase
) -> Option<(FileRange, SyntaxContextId)>
pub fn original_file_range_opt( self, db: &dyn ExpandDatabase ) -> Option<(FileRange, SyntaxContextId)>
Attempts to map the syntax node back up its macro calls.
pub fn original_syntax_node_rooted( self, db: &dyn ExpandDatabase ) -> Option<InRealFile<SyntaxNode>>
source§impl InFile<SyntaxToken>
impl InFile<SyntaxToken>
sourcepub fn original_file_range(self, db: &dyn ExpandDatabase) -> FileRange
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.
sourcepub fn original_file_range_opt(
self,
db: &dyn ExpandDatabase
) -> Option<FileRange>
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>
impl InFile<TextRange>
pub fn original_node_file_range( self, db: &dyn ExpandDatabase ) -> (FileRange, SyntaxContextId)
pub fn original_node_file_range_rooted( self, db: &dyn ExpandDatabase ) -> FileRange
pub fn original_node_file_range_with_macro_call_body( self, db: &dyn ExpandDatabase ) -> FileRange
pub fn original_node_file_range_opt( self, db: &dyn ExpandDatabase ) -> Option<(FileRange, SyntaxContextId)>
source§impl<N: AstNode> InFile<N>
impl<N: AstNode> InFile<N>
pub fn original_ast_node_rooted( self, db: &dyn ExpandDatabase ) -> Option<InRealFile<N>>
Trait Implementations§
source§impl<T> From<InFileWrapper<FileId, T>> for InFile<T>
impl<T> From<InFileWrapper<FileId, T>> for InFile<T>
source§fn from(_: InRealFile<T>) -> Self
fn from(_: InRealFile<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<InFileWrapper<MacroFileId, T>> for InFile<T>
impl<T> From<InFileWrapper<MacroFileId, T>> for InFile<T>
source§fn from(_: InMacroFile<T>) -> Self
fn from(_: InMacroFile<T>) -> Self
Converts to this type from the input type.