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>
impl<SN: Borrow<SyntaxNode>> InFile<SN>
pub fn parent_ancestors_with_macros( self, db: &dyn ExpandDatabase, ) -> impl Iterator<Item = InFile<SyntaxNode>> + '_
pub fn ancestors_with_macros( self, db: &dyn ExpandDatabase, ) -> impl Iterator<Item = InFile<SyntaxNode>> + '_
pub fn kind(&self) -> SyntaxKind
pub fn text_range(&self) -> TextRange
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.
pub fn original_syntax_node_rooted( self, db: &dyn ExpandDatabase, ) -> Option<InRealFile<SyntaxNode>>
source§impl InFile<&SyntaxNode>
impl InFile<&SyntaxNode>
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.
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>>
source§impl<T> InFile<T>
impl<T> InFile<T>
pub fn into_real_file(self) -> Result<InRealFile<T>, InFile<T>>
Trait Implementations§
source§impl<T> From<InFileWrapper<EditionedFileId, T>> for InFile<T>
impl<T> From<InFileWrapper<EditionedFileId, 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.