pub type InFile<T> = InFileWrapper<HirFileId, T>;Aliased Type§
pub struct InFile<T> {
pub file_id: HirFileId,
pub value: T,
}Fields§
§file_id: HirFileId§value: TImplementations§
Source§impl<SN: Borrow<SyntaxNode>> InFile<SN>
impl<SN: Borrow<SyntaxNode>> InFile<SN>
pub fn parent_ancestors_with_macros( self, db: &dyn SourceDatabase, ) -> impl Iterator<Item = InFile<SyntaxNode>> + '_
pub fn ancestors_with_macros( self, db: &dyn SourceDatabase, ) -> 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 SourceDatabase) -> FileRange
pub fn original_file_range_rooted(self, db: &dyn SourceDatabase) -> 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_input(
self,
db: &dyn SourceDatabase,
) -> FileRange
pub fn original_file_range_with_macro_call_input( self, db: &dyn SourceDatabase, ) -> 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 SourceDatabase, ) -> Option<InRealFile<SyntaxNode>>
Source§impl InFile<&SyntaxNode>
impl InFile<&SyntaxNode>
Sourcepub fn original_file_range_opt(
self,
db: &dyn SourceDatabase,
) -> Option<(FileRange, SyntaxContext)>
pub fn original_file_range_opt( self, db: &dyn SourceDatabase, ) -> Option<(FileRange, SyntaxContext)>
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 SourceDatabase) -> FileRange
pub fn original_file_range(self, db: &dyn SourceDatabase) -> 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 SourceDatabase,
) -> Option<FileRange>
pub fn original_file_range_opt( self, db: &dyn SourceDatabase, ) -> 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 SourceDatabase, ) -> (FileRange, SyntaxContext)
pub fn original_node_file_range_rooted( self, db: &dyn SourceDatabase, ) -> FileRange
pub fn original_node_file_range_with_macro_call_input( self, db: &dyn SourceDatabase, ) -> FileRange
pub fn original_node_file_range_opt( self, db: &dyn SourceDatabase, ) -> Option<(FileRange, SyntaxContext)>
pub fn original_node_file_range_rooted_opt( self, db: &dyn SourceDatabase, ) -> Option<FileRange>
Source§impl<N: AstNode> InFile<N>
impl<N: AstNode> InFile<N>
pub fn original_ast_node_rooted( self, db: &dyn SourceDatabase, ) -> 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<MacroCallId, T>> for InFile<T>
impl<T> From<InFileWrapper<MacroCallId, T>> for InFile<T>
Source§fn from(_: InMacroFile<T>) -> Self
fn from(_: InMacroFile<T>) -> Self
Converts to this type from the input type.