pub struct LanguageConfig {
pub name: &'static str,
pub ts_crate: &'static str,
pub class_types: HashSet<&'static str>,
pub function_types: HashSet<&'static str>,
pub import_types: HashSet<&'static str>,
pub call_types: HashSet<&'static str>,
pub name_field: &'static str,
pub body_field: &'static str,
pub call_function_field: &'static str,
pub function_boundary_types: HashSet<&'static str>,
pub function_label_parens: bool,
}Expand description
Metadata describing how to extract entities from a language’s AST.
Fields§
§name: &'static strHuman-readable language name.
ts_crate: &'static strCrate that provides the tree-sitter grammar (e.g. "tree_sitter_python").
class_types: HashSet<&'static str>AST node types that represent class-like definitions.
function_types: HashSet<&'static str>AST node types that represent function/method definitions.
import_types: HashSet<&'static str>AST node types that represent import statements.
call_types: HashSet<&'static str>AST node types that represent function calls.
name_field: &'static strField name for the entity name within the AST node.
body_field: &'static strField name for the body of a class/function.
call_function_field: &'static strField name for the function being called in a call expression.
function_boundary_types: HashSet<&'static str>AST node types that delimit function boundaries (for scope analysis).
function_label_parens: boolWhether the language uses parenthesised labels (e.g. Go func (r *Recv) Name()).
Trait Implementations§
Source§impl Clone for LanguageConfig
impl Clone for LanguageConfig
Source§fn clone(&self) -> LanguageConfig
fn clone(&self) -> LanguageConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LanguageConfig
impl RefUnwindSafe for LanguageConfig
impl Send for LanguageConfig
impl Sync for LanguageConfig
impl Unpin for LanguageConfig
impl UnsafeUnpin for LanguageConfig
impl UnwindSafe for LanguageConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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