pub struct TreeSitterProcessor { /* private fields */ }Expand description
An incremental Tree-sitter based document processor.
This processor tracks a parse tree and updates it based on TextDelta edits when available.
It then produces highlighting and folding edits in editor-core’s derived-state format.
Implementations§
Source§impl TreeSitterProcessor
impl TreeSitterProcessor
Sourcepub fn new(config: TreeSitterProcessorConfig) -> Result<Self, TreeSitterError>
pub fn new(config: TreeSitterProcessorConfig) -> Result<Self, TreeSitterError>
Create a new processor from the given config.
Sourcepub fn last_update_mode(&self) -> TreeSitterUpdateMode
pub fn last_update_mode(&self) -> TreeSitterUpdateMode
Get the last update mode (useful for tests and instrumentation).
Trait Implementations§
Source§impl DocumentProcessor for TreeSitterProcessor
impl DocumentProcessor for TreeSitterProcessor
Source§type Error = TreeSitterError
type Error = TreeSitterError
The error type returned by
DocumentProcessor::process.Source§fn process(
&mut self,
state: &EditorStateManager,
) -> Result<Vec<ProcessingEdit>, Self::Error>
fn process( &mut self, state: &EditorStateManager, ) -> Result<Vec<ProcessingEdit>, Self::Error>
Compute derived state updates to apply to the editor. Read more
Auto Trait Implementations§
impl Freeze for TreeSitterProcessor
impl RefUnwindSafe for TreeSitterProcessor
impl Send for TreeSitterProcessor
impl Sync for TreeSitterProcessor
impl Unpin for TreeSitterProcessor
impl UnsafeUnpin for TreeSitterProcessor
impl UnwindSafe for TreeSitterProcessor
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