Struct dioxus_autofmt::FormattedBlock
source · 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<FormattedBlock> for FormattedBlock
impl PartialEq<FormattedBlock> for FormattedBlock
source§fn eq(&self, other: &FormattedBlock) -> bool
fn eq(&self, other: &FormattedBlock) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.