Struct ra_ap_ide::Semantics [−][src]
pub struct Semantics<'db, DB> { pub db: &'db DB, // some fields omitted }
Expand description
Primary API to get semantic information, like types, from syntax trees.
Fields
db: &'db DB
Implementations
If item
has an attribute macro attached to it, expands it.
pub fn speculative_expand(
&self,
actual_macro_call: &MacroCall,
speculative_args: &TokenTree,
token_to_map: SyntaxToken<RustLanguage>
) -> Option<(SyntaxNode<RustLanguage>, SyntaxToken<RustLanguage>)>
[src]pub fn descend_into_macros(
&self,
token: SyntaxToken<RustLanguage>
) -> SyntaxToken<RustLanguage>
[src]pub fn descend_node_at_offset<N>(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
[src]pub fn token_ancestors_with_macros(
&self,
token: SyntaxToken<RustLanguage>
) -> impl Iterator<Item = SyntaxNode<RustLanguage>>
[src]pub fn ancestors_with_macros(
&self,
node: SyntaxNode<RustLanguage>
) -> impl Iterator<Item = SyntaxNode<RustLanguage>>
[src]pub fn ancestors_at_offset_with_macros(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> impl Iterator<Item = SyntaxNode<RustLanguage>>
[src]pub fn find_node_at_offset_with_macros<N>(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
[src]
pub fn find_node_at_offset_with_macros<N>(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
[src]Find a AstNode by offset inside SyntaxNode, if it is inside Macrofile, search up until it is of the target AstNode type
pub fn find_node_at_offset_with_descend<N>(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
[src]
pub fn find_node_at_offset_with_descend<N>(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
[src]Find a AstNode by offset inside SyntaxNode, if it is inside MacroCall, descend it and find again
pub fn resolve_record_field(
&self,
field: &RecordExprField
) -> Option<(Field, Option<Local>, Type)>
[src]pub fn record_literal_missing_fields(
&self,
literal: &RecordExpr
) -> Vec<(Field, Type), Global>
[src]pub fn record_pattern_missing_fields(
&self,
pattern: &RecordPat
) -> Vec<(Field, Type), Global>
[src]pub fn scope_at_offset(
&self,
token: &SyntaxToken<RustLanguage>,
offset: TextSize
) -> SemanticsScope<'db>
[src]Trait Implementations
Auto Trait Implementations
impl<'db, DB> !RefUnwindSafe for Semantics<'db, DB>
impl<'db, DB> !UnwindSafe for Semantics<'db, DB>
Blanket Implementations
Mutably borrows from an owned value. Read more
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
impl<T> Any for T where
T: Any,