Struct ide::SourceChange

source ·
pub struct SourceChange {
    pub source_file_edits: HashMap<FileId, (TextEdit, Option<SnippetEdit>), BuildHasherDefault<NoHashHasher<FileId>>>,
    pub file_system_edits: Vec<FileSystemEdit>,
    pub is_snippet: bool,
}

Fields§

§source_file_edits: HashMap<FileId, (TextEdit, Option<SnippetEdit>), BuildHasherDefault<NoHashHasher<FileId>>>§file_system_edits: Vec<FileSystemEdit>§is_snippet: bool

Implementations§

source§

impl SourceChange

source

pub fn from_edits( source_file_edits: HashMap<FileId, (TextEdit, Option<SnippetEdit>), BuildHasherDefault<NoHashHasher<FileId>>>, file_system_edits: Vec<FileSystemEdit>, ) -> SourceChange

Creates a new SourceChange with the given label from the edits.

source

pub fn from_text_edit( file_id: impl Into<FileId>, edit: TextEdit, ) -> SourceChange

source

pub fn insert_source_edit(&mut self, file_id: impl Into<FileId>, edit: TextEdit)

Inserts a TextEdit for the given FileId. This properly handles merging existing edits for a file if some already exist.

source

pub fn insert_source_and_snippet_edit( &mut self, file_id: impl Into<FileId>, edit: TextEdit, snippet_edit: Option<SnippetEdit>, )

Inserts a TextEdit and potentially a SnippetEdit for the given FileId. This properly handles merging existing edits for a file if some already exist.

source

pub fn push_file_system_edit(&mut self, edit: FileSystemEdit)

source

pub fn get_source_and_snippet_edit( &self, file_id: FileId, ) -> Option<&(TextEdit, Option<SnippetEdit>)>

source

pub fn merge(self, other: SourceChange) -> SourceChange

Trait Implementations§

source§

impl Clone for SourceChange

source§

fn clone(&self) -> SourceChange

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SourceChange

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for SourceChange

source§

fn default() -> SourceChange

Returns the “default value” for a type. Read more
source§

impl Extend<(FileId, (TextEdit, Option<SnippetEdit>))> for SourceChange

source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = (FileId, (TextEdit, Option<SnippetEdit>))>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Extend<(FileId, TextEdit)> for SourceChange

source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = (FileId, TextEdit)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Extend<FileSystemEdit> for SourceChange

source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = FileSystemEdit>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl From<FileSystemEdit> for SourceChange

source§

fn from(edit: FileSystemEdit) -> SourceChange

Converts to this type from the input type.
source§

impl From<HashMap<FileId, TextEdit, BuildHasherDefault<NoHashHasher<FileId>>>> for SourceChange

source§

fn from( source_file_edits: HashMap<FileId, TextEdit, BuildHasherDefault<NoHashHasher<FileId>>>, ) -> SourceChange

Converts to this type from the input type.
source§

impl FromIterator<(FileId, TextEdit)> for SourceChange

source§

fn from_iter<T>(iter: T) -> SourceChange
where T: IntoIterator<Item = (FileId, TextEdit)>,

Creates a value from an iterator. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Cast for T

§

fn cast<U>(self, interner: <U as HasInterner>::Interner) -> U
where Self: CastTo<U>, U: HasInterner,

Cast a value to type U using CastTo.
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoBox<dyn Any> for T
where T: Any,

§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Sync + Send> for T
where T: Any + Send + Sync,

§

fn into_box(self) -> Box<dyn Any + Sync + Send>

Convert self into the appropriate boxed form.
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<'a, T> Captures<'a> for T
where T: ?Sized,