Struct tree_sitter::Tree [−][src]
pub struct Tree(_);
Expand description
A tree that represents the syntactic structure of a source code file.
Implementations
impl Tree
[src]
impl Tree
[src]pub fn edit(&mut self, edit: &InputEdit)
[src]
pub fn edit(&mut self, edit: &InputEdit)
[src]Edit the syntax tree to keep it in sync with source code that has been edited.
You must describe the edit both in terms of byte offsets and in terms of row/column coordinates.
pub fn walk(&self) -> TreeCursor<'_>
[src]
pub fn walk(&self) -> TreeCursor<'_>
[src]Create a new TreeCursor starting from the root of the tree.
pub fn changed_ranges(
&self,
other: &Tree
) -> impl ExactSizeIterator<Item = Range>
[src]
pub fn changed_ranges(
&self,
other: &Tree
) -> impl ExactSizeIterator<Item = Range>
[src]Compare this old edited syntax tree to a new syntax tree representing the same document, returning a sequence of ranges whose syntactic structure has changed.
For this to work correctly, this syntax tree must have been edited such that its
ranges match up to the new tree. Generally, you’ll want to call this method right
after calling one of the Parser::parse functions. Call it on the old tree that
was passed to parse, and pass the new tree that was returned from parse
.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more