pub struct FileAutocompleteManager { /* private fields */ }Expand description
Manages file autocomplete state and operations
Implementations§
Source§impl FileAutocompleteManager
impl FileAutocompleteManager
Sourcepub fn state(&self) -> Option<&AutocompleteState>
pub fn state(&self) -> Option<&AutocompleteState>
Get current autocomplete state
Sourcepub fn state_mut(&mut self) -> Option<&mut AutocompleteState>
pub fn state_mut(&mut self) -> Option<&mut AutocompleteState>
Get mutable autocomplete state
Sourcepub fn activate(&mut self, trigger_pos: usize)
pub fn activate(&mut self, trigger_pos: usize)
Activate autocomplete at the given trigger position
Sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Deactivate autocomplete
Sourcepub fn update_query(&mut self, query: &str)
pub fn update_query(&mut self, query: &str)
Update the query and refresh matches
Sourcepub fn append_char(&mut self, c: char)
pub fn append_char(&mut self, c: char)
Add a character to the query (avoids String allocation)
Navigate up in matches
Navigate down in matches
Sourcepub fn selected_match(&self) -> Option<&FileMatchData>
pub fn selected_match(&self) -> Option<&FileMatchData>
Get selected match
Sourcepub fn trigger_pos(&self) -> Option<usize>
pub fn trigger_pos(&self) -> Option<usize>
Get trigger position
Sourcepub fn accept_completion(&mut self) -> Option<String>
pub fn accept_completion(&mut self) -> Option<String>
Accept selected completion and return the text to insert
Sourcepub fn to_legacy_state(&self) -> Option<FileAutocompleteState>
pub fn to_legacy_state(&self) -> Option<FileAutocompleteState>
Convert to legacy FileAutocompleteState for rendering
Auto Trait Implementations§
impl Freeze for FileAutocompleteManager
impl RefUnwindSafe for FileAutocompleteManager
impl Send for FileAutocompleteManager
impl Sync for FileAutocompleteManager
impl Unpin for FileAutocompleteManager
impl UnsafeUnpin for FileAutocompleteManager
impl UnwindSafe for FileAutocompleteManager
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> 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