pub struct CompletionSnapshot {
pub items: Vec<CompletionItem>,
pub prefix: String,
pub buffer_id: usize,
pub cursor_row: u32,
pub cursor_col: u32,
pub word_start_col: u32,
pub timestamp: Instant,
pub active: bool,
pub selected_index: usize,
}Expand description
A snapshot of completion state at a point in time
Fields§
§items: Vec<CompletionItem>Completion items (already filtered and sorted)
prefix: StringThe prefix used for filtering
buffer_id: usizeBuffer ID this completion is for
cursor_row: u32Cursor position when completion was triggered
cursor_col: u32§word_start_col: u32Column where the word being completed starts
timestamp: InstantWhen this snapshot was created
active: boolWhether completion is active
selected_index: usizeCurrently selected index
Implementations§
Source§impl CompletionSnapshot
impl CompletionSnapshot
Sourcepub fn new(
items: Vec<CompletionItem>,
prefix: String,
buffer_id: usize,
cursor_row: u32,
cursor_col: u32,
word_start_col: u32,
) -> Self
pub fn new( items: Vec<CompletionItem>, prefix: String, buffer_id: usize, cursor_row: u32, cursor_col: u32, word_start_col: u32, ) -> Self
Create a new active snapshot with items
Sourcepub fn selected_item(&self) -> Option<&CompletionItem>
pub fn selected_item(&self) -> Option<&CompletionItem>
Get the currently selected item
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Get the number of items
Trait Implementations§
Source§impl Clone for CompletionSnapshot
impl Clone for CompletionSnapshot
Source§fn clone(&self) -> CompletionSnapshot
fn clone(&self) -> CompletionSnapshot
Returns a duplicate 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 CompletionSnapshot
impl Debug for CompletionSnapshot
Auto Trait Implementations§
impl Freeze for CompletionSnapshot
impl RefUnwindSafe for CompletionSnapshot
impl Send for CompletionSnapshot
impl Sync for CompletionSnapshot
impl Unpin for CompletionSnapshot
impl UnwindSafe for CompletionSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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