pub struct QueryEngine { /* private fields */ }Expand description
Query engine for semantic analysis using Tree-sitter queries
Implementations§
Source§impl QueryEngine
impl QueryEngine
Sourcepub fn new(
language: Language,
language_name: &str,
) -> Result<Self, ContextCreatorError>
pub fn new( language: Language, language_name: &str, ) -> Result<Self, ContextCreatorError>
Create a new query engine for the specified language
Sourcepub fn analyze_with_parser(
&self,
parser: &mut Parser,
content: &str,
) -> Result<AnalysisResult, ContextCreatorError>
pub fn analyze_with_parser( &self, parser: &mut Parser, content: &str, ) -> Result<AnalysisResult, ContextCreatorError>
Analyze content using Tree-sitter queries
Sourcepub fn analyze_tree(
&self,
tree: &Tree,
content: &str,
) -> Result<AnalysisResult, ContextCreatorError>
pub fn analyze_tree( &self, tree: &Tree, content: &str, ) -> Result<AnalysisResult, ContextCreatorError>
Analyze a parsed tree using queries
Sourcepub fn resolve_type_definitions(
&self,
type_refs: &mut [TypeReference],
current_file: &Path,
project_root: &Path,
) -> Result<(), ContextCreatorError>
pub fn resolve_type_definitions( &self, type_refs: &mut [TypeReference], current_file: &Path, project_root: &Path, ) -> Result<(), ContextCreatorError>
Resolve type definitions for type references This method attempts to find the file that defines each type
Auto Trait Implementations§
impl Freeze for QueryEngine
impl RefUnwindSafe for QueryEngine
impl Send for QueryEngine
impl Sync for QueryEngine
impl Unpin for QueryEngine
impl UnwindSafe for QueryEngine
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more