Manages LSP completion request lifecycle.
Summary
Types
Exclusive completion trigger phase tracked in the Editor.
Cursor position captured when completion was triggered.
Role assigned to a completion request reference within a batch.
Completion bridge state tracked in the Editor.
Request tracking fact returned to the Editor-global LSP owner.
Functions
Dismisses any active completion state and cancels debounce timer ownership.
Called when the debounce timer fires.
Returns the latest-wins request generation.
Returns the text typed since the trigger position (for prefix filtering).
Checks whether the given character should trigger completion.
Returns initial completion bridge state.
Types
@type phase() :: :idle | {:debounced, reference(), [pid()], pid(), non_neg_integer(), position()} | {:pending, position()}
Exclusive completion trigger phase tracked in the Editor.
@type position() :: {non_neg_integer(), non_neg_integer()}
Cursor position captured when completion was triggered.
@type response_role() :: :primary | :secondary
Role assigned to a completion request reference within a batch.
@type t() :: %MingaEditor.CompletionTrigger{gen: non_neg_integer(), phase: phase()}
Completion bridge state tracked in the Editor.
@type tracking_fact() :: {reference(), response_role(), pid(), pid(), non_neg_integer(), non_neg_integer(), position()}
Request tracking fact returned to the Editor-global LSP owner.
Functions
Dismisses any active completion state and cancels debounce timer ownership.
@spec flush_debounce(t(), non_neg_integer()) :: {t(), [tracking_fact()]}
Called when the debounce timer fires.
@spec generation(t()) :: non_neg_integer()
Returns the latest-wins request generation.
Returns the text typed since the trigger position (for prefix filtering).
@spec maybe_trigger(t(), String.t(), pid()) :: {t(), [tracking_fact()]}
Checks whether the given character should trigger completion.
@spec new() :: t()
Returns initial completion bridge state.