pub struct SnippetSession { /* private fields */ }Expand description
An active snippet session tracked in document coordinates.
This is a view-local editing state: it is expected to be stored alongside cursor/selection
state (e.g. per ViewId in a Workspace).
Implementations§
Source§impl SnippetSession
impl SnippetSession
Sourcepub fn new(insert_start: usize, template: &SnippetTemplate) -> Option<Self>
pub fn new(insert_start: usize, template: &SnippetTemplate) -> Option<Self>
Create a snippet session for an inserted template.
insert_startis the character offset wheretemplate.textbegins in the document.- Returns
Nonewhentemplatecontains no tabstops (nothing to navigate).
Sourcepub fn apply_delta(&mut self, delta: &TextDelta)
pub fn apply_delta(&mut self, delta: &TextDelta)
Shift all tracked placeholder/final offsets through a document text delta.
Trait Implementations§
Source§impl Clone for SnippetSession
impl Clone for SnippetSession
Source§impl Debug for SnippetSession
impl Debug for SnippetSession
impl Eq for SnippetSession
Source§impl PartialEq for SnippetSession
impl PartialEq for SnippetSession
impl StructuralPartialEq for SnippetSession
Auto Trait Implementations§
impl Forget for SnippetSession
impl Freeze for SnippetSession
impl Move for SnippetSession
impl RefUnwindSafe for SnippetSession
impl Send for SnippetSessionwhere
RawVecInner: Send,
impl Sync for SnippetSessionwhere
RawVecInner: Sync,
impl Unpin for SnippetSession
impl UnsafeUnpin for SnippetSession
impl UnwindSafe for SnippetSessionwhere
RawVecInner: UnwindSafe,
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