pub struct DidChangeNotebookDocumentParams {
pub notebook_document: VersionedNotebookDocumentIdentifier,
pub change: NotebookDocumentChangeEvent,
}Expand description
The params sent in a change notebook document notification.
@since 3.17.0
Fields§
§notebook_document: VersionedNotebookDocumentIdentifierThe notebook document that did change. The version number points to the version after all provided changes have been applied. If only the text document content of a cell changes the notebook version doesn’t necessarily have to change.
change: NotebookDocumentChangeEventThe actual changes to the notebook document.
The changes describe single state changes to the notebook document. So if there are two changes c1 (at array index 0) and c2 (at array index 1) for a notebook in state S then c1 moves the notebook from S to S’ and c2 from S’ to S’‘. So c1 is computed on the state S and c2 is computed on the state S’.
To mirror the content of a notebook using change events use the following approach:
- start with the same initial content
- apply the ‘notebookDocument/didChange’ notifications in the order you receive them.
- apply the
NotebookChangeEvents in a single notification in the order you receive them.
Implementations§
Source§impl DidChangeNotebookDocumentParams
impl DidChangeNotebookDocumentParams
pub const fn new( notebook_document: VersionedNotebookDocumentIdentifier, change: NotebookDocumentChangeEvent, ) -> Self
Trait Implementations§
Source§impl Clone for DidChangeNotebookDocumentParams
impl Clone for DidChangeNotebookDocumentParams
Source§fn clone(&self) -> DidChangeNotebookDocumentParams
fn clone(&self) -> DidChangeNotebookDocumentParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for DidChangeNotebookDocumentParams
impl<'de> Deserialize<'de> for DidChangeNotebookDocumentParams
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 PartialEq for DidChangeNotebookDocumentParams
impl PartialEq for DidChangeNotebookDocumentParams
Source§fn eq(&self, other: &DidChangeNotebookDocumentParams) -> bool
fn eq(&self, other: &DidChangeNotebookDocumentParams) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for DidChangeNotebookDocumentParams
impl StructuralPartialEq for DidChangeNotebookDocumentParams
Auto Trait Implementations§
impl Freeze for DidChangeNotebookDocumentParams
impl RefUnwindSafe for DidChangeNotebookDocumentParams
impl Send for DidChangeNotebookDocumentParams
impl Sync for DidChangeNotebookDocumentParams
impl Unpin for DidChangeNotebookDocumentParams
impl UnsafeUnpin for DidChangeNotebookDocumentParams
impl UnwindSafe for DidChangeNotebookDocumentParams
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