pub struct InputEdit {
pub start_byte: usize,
pub old_end_byte: usize,
pub new_end_byte: usize,
pub start_position: Point,
pub old_end_position: Point,
pub new_end_position: Point,
}Expand description
A summary of a change to a text document.
Fields§
§start_byte: usize§old_end_byte: usize§new_end_byte: usize§start_position: Point§old_end_position: Point§new_end_position: PointImplementations§
Source§impl InputEdit
impl InputEdit
Sourcepub fn edit_point(&self, point: &mut Point, byte: &mut usize)
pub fn edit_point(&self, point: &mut Point, byte: &mut usize)
Edit a point to keep it in-sync with source code that has been edited.
This function updates a single point’s byte offset and row/column position based on this edit operation. This is useful for editing points without requiring a tree or node instance.
Sourcepub fn edit_range(&self, range: &mut Range)
pub fn edit_range(&self, range: &mut Range)
Edit a range to keep it in-sync with source code that has been edited.
This function updates a range’s start and end positions based on this edit operation. This is useful for editing ranges without requiring a tree or node instance.
Trait Implementations§
Source§impl From<&InputEdit> for TSInputEdit
impl From<&InputEdit> for TSInputEdit
impl Copy for InputEdit
impl Eq for InputEdit
impl StructuralPartialEq for InputEdit
Auto Trait Implementations§
impl Freeze for InputEdit
impl RefUnwindSafe for InputEdit
impl Send for InputEdit
impl Sync for InputEdit
impl Unpin for InputEdit
impl UnwindSafe for InputEdit
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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