LSP coordination state for the Editor.
Groups the Editor's LSP-related fields into a focused sub-struct: server status tracking, cached responses (code lenses, inlay hints, selection ranges), and debounce timers for highlight and inlay hint requests.
All mutations go through functions on this module. Other modules
read fields directly but never do %{lsp | field: value}.
Summary
Functions
Appends a single resolved code lens entry.
Returns a pure instruction for canceling the highlight debounce timer.
Returns a pure instruction for canceling the inlay hint debounce timer.
Clears the highlight debounce timer reference without cancelling it.
Clears the inlay hint debounce timer reference without cancelling it.
Clears the stored selection ranges and resets the index.
Drops a formatting operation by request reference.
Moves the selection range index forward (expand) by one step.
Fetches a formatting operation by request reference.
Returns whether a formatting operation is active.
Returns the formatting operation for one Buffer.
Returns the newest active formatting operation.
Records the viewport top used by the latest inlay-hint request.
Replaces the stored code lenses.
Sets the highlight debounce timer reference.
Sets the inlay hint debounce timer and records the viewport top.
Replaces the stored inlay hints.
Stores a selection range chain and resets the index to 0.
Moves the selection range index backward (shrink) by one step.
Takes an Editor-global LSP operation request by response reference.
Takes all structured operation requests originating from one departing tab.
Tracks an Editor-global formatting operation.
Tracks an Editor-global LSP request for a structured operation.
Updates a single server's status and re-derives the aggregate status.
Types
@type operation_request() :: {:references | :rename, pos_integer(), pos_integer() | nil}
@type server_status() :: :starting | :initializing | :ready | :crashed
@type t() :: %MingaEditor.State.LSP{ code_lenses: [map()], format_operations: MingaEditor.State.LSP.FormatOperations.t(), highlight_debounce_timer: reference() | nil, inlay_hint_debounce_timer: reference() | nil, inlay_hints: [map()], last_inlay_viewport_top: non_neg_integer() | nil, operation_requests: %{required(reference()) => operation_request()}, selection_range_index: non_neg_integer(), selection_ranges: [map()] | nil, server_statuses: %{required(atom()) => server_status()}, status: MingaEditor.Shell.Traditional.Modeline.lsp_status() }
Functions
Appends a single resolved code lens entry.
Returns a pure instruction for canceling the highlight debounce timer.
Returns a pure instruction for canceling the inlay hint debounce timer.
Clears the highlight debounce timer reference without cancelling it.
Clears the inlay hint debounce timer reference without cancelling it.
Clears the stored selection ranges and resets the index.
Drops a formatting operation by request reference.
Moves the selection range index forward (expand) by one step.
@spec fetch_format(t(), reference()) :: {:ok, MingaEditor.State.LSP.FormatOperation.t()} | :error
Fetches a formatting operation by request reference.
Returns whether a formatting operation is active.
@spec format_for_buffer(t(), pid()) :: MingaEditor.State.LSP.FormatOperation.t() | nil
Returns the formatting operation for one Buffer.
@spec newest_format(t()) :: MingaEditor.State.LSP.FormatOperation.t() | nil
Returns the newest active formatting operation.
@spec remember_inlay_viewport(t(), non_neg_integer()) :: t()
Records the viewport top used by the latest inlay-hint request.
Replaces the stored code lenses.
Sets the highlight debounce timer reference.
@spec set_inlay_hint_timer(t(), reference(), non_neg_integer()) :: t()
Sets the inlay hint debounce timer and records the viewport top.
Replaces the stored inlay hints.
Stores a selection range chain and resets the index to 0.
Moves the selection range index backward (shrink) by one step.
@spec take_operation_request(t(), reference()) :: {:ok, operation_request(), t()} | :error
Takes an Editor-global LSP operation request by response reference.
@spec take_operation_requests_for_tab(t(), pos_integer()) :: {[operation_request()], t()}
Takes all structured operation requests originating from one departing tab.
@spec track_format(t(), MingaEditor.State.LSP.FormatOperation.t()) :: t()
Tracks an Editor-global formatting operation.
@spec track_operation_request(t(), reference(), operation_request()) :: t()
Tracks an Editor-global LSP request for a structured operation.
Updates a single server's status and re-derives the aggregate status.
When status is :stopped, the server is removed from the map entirely.