pub struct SharedCompletionManager {
pub registry: RwLock<SourceRegistry>,
pub cache: Arc<CompletionCache>,
pub saturator: RwLock<Option<CompletionSaturatorHandle>>,
pub debounce_generation: AtomicU64,
pub inner_event_tx: RwLock<Option<Sender<RuntimeEvent>>>,
}Expand description
Shared completion manager state
Holds the source registry, cache, and saturator handle. Registered in PluginStateRegistry for cross-plugin access.
Fields§
§registry: RwLock<SourceRegistry>Registry of completion sources
cache: Arc<CompletionCache>Lock-free completion cache
saturator: RwLock<Option<CompletionSaturatorHandle>>Saturator handle (set after boot)
debounce_generation: AtomicU64Debounce generation counter for auto-popup Each keystroke increments this; the timer checks if it’s still current
inner_event_tx: RwLock<Option<Sender<RuntimeEvent>>>Inner event sender for sending CommandEvent after debounce
Implementations§
Sourcepub fn set_inner_event_tx(&self, tx: Sender<RuntimeEvent>)
pub fn set_inner_event_tx(&self, tx: Sender<RuntimeEvent>)
Set the inner event sender (called during boot)
Sourcepub fn next_debounce_generation(&self) -> u64
pub fn next_debounce_generation(&self) -> u64
Increment debounce generation and return the new value
Called when user types; the returned generation is used to check if the debounce timer is still valid.
Sourcepub fn current_debounce_generation(&self) -> u64
pub fn current_debounce_generation(&self) -> u64
Get current debounce generation
Sourcepub fn request_render(&self)
pub fn request_render(&self)
Request a render signal (used after debounce timeout)
Sourcepub fn send_command_event(&self, event: CommandEvent)
pub fn send_command_event(&self, event: CommandEvent)
Send a command event to trigger completion
Used by auto-popup to trigger CompletionTrigger command after debounce. The command will execute with proper buffer context.
Sourcepub fn register_source(&self, source: Arc<dyn SourceSupport>)
pub fn register_source(&self, source: Arc<dyn SourceSupport>)
Register a completion source
Sourcepub fn sources(&self) -> Arc<Vec<Arc<dyn SourceSupport>>>
pub fn sources(&self) -> Arc<Vec<Arc<dyn SourceSupport>>>
Get all registered sources as Arc vec for saturator
Sourcepub fn set_saturator(&self, handle: CompletionSaturatorHandle)
pub fn set_saturator(&self, handle: CompletionSaturatorHandle)
Set the saturator handle (called during boot)
Sourcepub fn request_completion(&self, request: CompletionRequest)
pub fn request_completion(&self, request: CompletionRequest)
Request completion (delegates to saturator)
Sourcepub fn select_next(&self)
pub fn select_next(&self)
Select next completion item
Sourcepub fn select_prev(&self)
pub fn select_prev(&self)
Select previous completion item
Sourcepub fn snapshot(&self) -> Arc<CompletionSnapshot>
pub fn snapshot(&self) -> Arc<CompletionSnapshot>
Get current snapshot
Trait Implementations§
Auto Trait Implementations§
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
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>
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>
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