pub struct RustAnalyzer { /* private fields */ }
Expand description
AST analyzer for Rust source code
Implementations§
Source§impl RustAnalyzer
impl RustAnalyzer
Sourcepub fn parse(&mut self, source: &str) -> RazResult<Tree>
pub fn parse(&mut self, source: &str) -> RazResult<Tree>
Parse source code and return the syntax tree
Sourcepub fn extract_symbols(
&self,
tree: &Tree,
source: &str,
) -> RazResult<Vec<Symbol>>
pub fn extract_symbols( &self, tree: &Tree, source: &str, ) -> RazResult<Vec<Symbol>>
Extract all symbols from the AST
Sourcepub fn symbol_at_position(
&self,
tree: &Tree,
source: &str,
position: Position,
) -> RazResult<Option<Symbol>>
pub fn symbol_at_position( &self, tree: &Tree, source: &str, position: Position, ) -> RazResult<Option<Symbol>>
Find the symbol at a specific cursor position
Sourcepub fn context_at_position(
&self,
tree: &Tree,
source: &str,
position: Position,
) -> RazResult<SymbolContext>
pub fn context_at_position( &self, tree: &Tree, source: &str, position: Position, ) -> RazResult<SymbolContext>
Get the context around a cursor position (parent functions, modules, etc.)
Auto Trait Implementations§
impl Freeze for RustAnalyzer
impl RefUnwindSafe for RustAnalyzer
impl Send for RustAnalyzer
impl Sync for RustAnalyzer
impl Unpin for RustAnalyzer
impl UnwindSafe for RustAnalyzer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more