Struct ra_ap_ide::Semantics [−][src]
Primary API to get semantic information, like types, from syntax trees.
Fields
db: &'db DB
Implementations
impl<'db, DB> Semantics<'db, DB> where
DB: HirDatabase,
[src]
DB: HirDatabase,
pub fn new(db: &DB) -> Semantics<'_, DB>
[src]
pub fn parse(&self, file_id: FileId) -> SourceFile
[src]
pub fn expand(&self, macro_call: &MacroCall) -> Option<SyntaxNode<RustLanguage>>
[src]
pub fn speculative_expand(
&self,
actual_macro_call: &MacroCall,
hypothetical_args: &TokenTree,
token_to_map: SyntaxToken<RustLanguage>
) -> Option<(SyntaxNode<RustLanguage>, SyntaxToken<RustLanguage>)>
[src]
&self,
actual_macro_call: &MacroCall,
hypothetical_args: &TokenTree,
token_to_map: SyntaxToken<RustLanguage>
) -> Option<(SyntaxNode<RustLanguage>, SyntaxToken<RustLanguage>)>
pub fn descend_into_macros(
&self,
token: SyntaxToken<RustLanguage>
) -> SyntaxToken<RustLanguage>
[src]
&self,
token: SyntaxToken<RustLanguage>
) -> SyntaxToken<RustLanguage>
pub fn descend_node_at_offset<N>(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
[src]
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
pub fn original_range(&self, node: &SyntaxNode<RustLanguage>) -> FileRange
[src]
pub fn diagnostics_display_range(
&self,
diagnostics: &(dyn Diagnostic + 'static)
) -> FileRange
[src]
&self,
diagnostics: &(dyn Diagnostic + 'static)
) -> FileRange
pub fn ancestors_with_macros(
&self,
node: SyntaxNode<RustLanguage>
) -> impl Iterator<Item = SyntaxNode<RustLanguage>>
[src]
&self,
node: SyntaxNode<RustLanguage>
) -> impl Iterator<Item = SyntaxNode<RustLanguage>>
pub fn ancestors_at_offset_with_macros(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> impl Iterator<Item = SyntaxNode<RustLanguage>>
[src]
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> impl Iterator<Item = SyntaxNode<RustLanguage>>
pub fn find_node_at_offset_with_macros<N>(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
[src]
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
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]
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> Option<N> where
N: AstNode,
Find a AstNode by offset inside SyntaxNode, if it is inside MacroCall, descend it and find again
pub fn resolve_lifetime_param(
&self,
lifetime: &Lifetime
) -> Option<LifetimeParam>
[src]
&self,
lifetime: &Lifetime
) -> Option<LifetimeParam>
pub fn resolve_label(&self, lifetime: &Lifetime) -> Option<Label>
[src]
pub fn type_of_expr(&self, expr: &Expr) -> Option<Type>
[src]
pub fn type_of_pat(&self, pat: &Pat) -> Option<Type>
[src]
pub fn type_of_self(&self, param: &SelfParam) -> Option<Type>
[src]
pub fn resolve_method_call(&self, call: &MethodCallExpr) -> Option<Function>
[src]
pub fn resolve_method_call_as_callable(
&self,
call: &MethodCallExpr
) -> Option<Callable>
[src]
&self,
call: &MethodCallExpr
) -> Option<Callable>
pub fn resolve_field(&self, field: &FieldExpr) -> Option<Field>
[src]
pub fn resolve_record_field(
&self,
field: &RecordExprField
) -> Option<(Field, Option<Local>)>
[src]
&self,
field: &RecordExprField
) -> Option<(Field, Option<Local>)>
pub fn resolve_record_pat_field(&self, field: &RecordPatField) -> Option<Field>
[src]
pub fn resolve_macro_call(&self, macro_call: &MacroCall) -> Option<MacroDef>
[src]
pub fn resolve_path(&self, path: &Path) -> Option<PathResolution>
[src]
pub fn resolve_extern_crate(&self, extern_crate: &ExternCrate) -> Option<Crate>
[src]
pub fn resolve_variant(&self, record_lit: RecordExpr) -> Option<VariantDef>
[src]
pub fn resolve_bind_pat_to_const(&self, pat: &IdentPat) -> Option<ModuleDef>
[src]
pub fn record_literal_missing_fields(
&self,
literal: &RecordExpr
) -> Vec<(Field, Type), Global>
[src]
&self,
literal: &RecordExpr
) -> Vec<(Field, Type), Global>
pub fn record_pattern_missing_fields(
&self,
pattern: &RecordPat
) -> Vec<(Field, Type), Global>
[src]
&self,
pattern: &RecordPat
) -> Vec<(Field, Type), Global>
pub fn to_def<T>(&self, src: &T) -> Option<<T as ToDef>::Def> where
T: ToDef,
[src]
T: ToDef,
pub fn to_module_def(&self, file: FileId) -> Option<Module>
[src]
pub fn scope(&self, node: &SyntaxNode<RustLanguage>) -> SemanticsScope<'db>
[src]
pub fn scope_at_offset(
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> SemanticsScope<'db>
[src]
&self,
node: &SyntaxNode<RustLanguage>,
offset: TextSize
) -> SemanticsScope<'db>
pub fn scope_for_def(&self, def: Trait) -> SemanticsScope<'db>
[src]
pub fn assert_contains_node(&self, node: &SyntaxNode<RustLanguage>)
[src]
pub fn is_unsafe_method_call(&self, method_call_expr: &MethodCallExpr) -> bool
[src]
pub fn is_unsafe_ref_expr(&self, ref_expr: &RefExpr) -> bool
[src]
pub fn is_unsafe_ident_pat(&self, ident_pat: &IdentPat) -> bool
[src]
Trait Implementations
Auto Trait Implementations
impl<'db, DB> !RefUnwindSafe for Semantics<'db, DB>
[src]
impl<'db, DB> !Send for Semantics<'db, DB>
[src]
impl<'db, DB> !Sync for Semantics<'db, DB>
[src]
impl<'db, DB> Unpin for Semantics<'db, DB>
[src]
impl<'db, DB> !UnwindSafe for Semantics<'db, DB>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Cast for T
pub fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Self: CastTo<U>,
U: HasInterner,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,