pub struct FormattedBlock {
pub formatted: String,
pub start: usize,
pub end: usize,
}
Expand description
A modification to the original file to be applied by an IDE
Right now this re-writes entire rsx! blocks at a time, instead of precise line-by-line changes.
In a “perfect” world we would have tiny edits to preserve things like cursor states and selections. The API here makes it possible to migrate to a more precise modification approach in the future without breaking existing code.
Note that this is tailored to VSCode’s TextEdit API and not a general Diff API. Line numbers are not accurate if multiple edits are applied in a single file without tracking text shifts.
Fields§
§formatted: String
The new contents of the block
start: usize
The line number of the first line of the block.
end: usize
The end of the block, exclusive.
Trait Implementations§
Source§impl Clone for FormattedBlock
impl Clone for FormattedBlock
Source§fn clone(&self) -> FormattedBlock
fn clone(&self) -> FormattedBlock
Returns a copy 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 FormattedBlock
impl Debug for FormattedBlock
Source§impl<'de> Deserialize<'de> for FormattedBlock
impl<'de> Deserialize<'de> for FormattedBlock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for FormattedBlock
impl Hash for FormattedBlock
Source§impl PartialEq for FormattedBlock
impl PartialEq for FormattedBlock
Source§impl Serialize for FormattedBlock
impl Serialize for FormattedBlock
impl Eq for FormattedBlock
impl StructuralPartialEq for FormattedBlock
Auto Trait Implementations§
impl Freeze for FormattedBlock
impl RefUnwindSafe for FormattedBlock
impl Send for FormattedBlock
impl Sync for FormattedBlock
impl Unpin for FormattedBlock
impl UnwindSafe for FormattedBlock
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