pub struct TreeSitterAnalyzer { /* private fields */ }Implementations§
Source§impl TreeSitterAnalyzer
impl TreeSitterAnalyzer
pub fn new() -> Self
Sourcepub fn find_containing_symbol(
&self,
file_path: &Path,
line_number: usize,
project_root: &Path,
) -> Option<String>
pub fn find_containing_symbol( &self, file_path: &Path, line_number: usize, project_root: &Path, ) -> Option<String>
Given a file path and a 1-based line number, find the innermost
named definition (function, struct, enum, trait, impl) that contains
that line. Returns a canonical CodeStruct-style selector like
src/foo.rs::fn authenticate #L10-L20.
pub fn find_containing_symbol_match( &self, file_path: &Path, line_number: usize, ) -> Option<SymbolMatch>
pub fn resolve_selector( &self, file_path: &Path, parsed: &ParsedSelector, ) -> Result<SymbolMatch, String>
pub fn symbols_in_file( &self, file_path: &Path, ) -> Result<Vec<SymbolMatch>, String>
pub fn is_import_only_reference( &self, file_path: &Path, line_number: usize, ) -> bool
Sourcepub fn can_parse(&self, ext: &str, content: &str) -> bool
pub fn can_parse(&self, ext: &str, content: &str) -> bool
Validate that a file’s content can be parsed by tree-sitter. Returns true if parsing succeeds (i.e. the file is syntactically valid for the given language), false otherwise.
Sourcepub fn responsible_language_for_extension(
&self,
ext: &str,
) -> Option<&'static str>
pub fn responsible_language_for_extension( &self, ext: &str, ) -> Option<&'static str>
Return the SCOPE language adapter that owns semantic source operations for the given extension.
Sourcepub fn is_responsible_source_path(&self, file_path: &Path) -> bool
pub fn is_responsible_source_path(&self, file_path: &Path) -> bool
Return true when SCOPE owns semantic source operations for this path.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TreeSitterAnalyzer
impl !UnwindSafe for TreeSitterAnalyzer
impl Freeze for TreeSitterAnalyzer
impl Send for TreeSitterAnalyzer
impl Sync for TreeSitterAnalyzer
impl Unpin for TreeSitterAnalyzer
impl UnsafeUnpin for TreeSitterAnalyzer
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