pub struct ProcessConfig {
pub language: Cow<'static, str>,
pub structure: bool,
pub imports: bool,
pub exports: bool,
pub comments: bool,
pub docstrings: bool,
pub symbols: bool,
pub diagnostics: bool,
pub chunk_max_size: Option<usize>,
pub extractions: Option<AHashMap<String, ExtractionPattern>>,
}Expand description
Configuration for the process() function.
Controls which analysis features are enabled and whether chunking is performed.
§Examples
use tree_sitter_language_pack::ProcessConfig;
// Defaults: structure + imports + exports enabled
let config = ProcessConfig::new("python");
// With chunking
let config = ProcessConfig::new("python").with_chunking(1000);
// Everything enabled
let config = ProcessConfig::new("python").all();Fields§
§language: Cow<'static, str>Language name (required).
structure: boolExtract structural items (functions, classes, etc.). Default: true.
imports: boolExtract import statements. Default: true.
exports: boolExtract export statements. Default: true.
comments: boolExtract comments. Default: false.
docstrings: boolExtract docstrings. Default: false.
symbols: boolExtract symbol definitions. Default: false.
diagnostics: boolInclude parse diagnostics. Default: false.
chunk_max_size: Option<usize>Maximum chunk size in bytes. None disables chunking.
extractions: Option<AHashMap<String, ExtractionPattern>>Custom extraction patterns to run against the parsed tree.
Keys become the keys in ProcessResult::extractions.
Implementations§
Source§impl ProcessConfig
impl ProcessConfig
Trait Implementations§
Source§impl Clone for ProcessConfig
impl Clone for ProcessConfig
Source§fn clone(&self) -> ProcessConfig
fn clone(&self) -> ProcessConfig
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 moreSource§impl Debug for ProcessConfig
impl Debug for ProcessConfig
Auto Trait Implementations§
impl Freeze for ProcessConfig
impl RefUnwindSafe for ProcessConfig
impl Send for ProcessConfig
impl Sync for ProcessConfig
impl Unpin for ProcessConfig
impl UnsafeUnpin for ProcessConfig
impl UnwindSafe for ProcessConfig
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