Pure indexes for current Editor-global LSP formatting operations.
One operation may be current per Buffer. The newest active operation is tracked for Esc cancellation while requests for unrelated buffers remain independent.
Summary
Functions
Drops an operation by request reference.
Fetches an operation by its external request reference.
Returns the operation for one Buffer.
Returns an empty operation collection.
Returns the newest active operation.
Tracks an operation when its Buffer has no current request.
Types
@type t() :: %MingaEditor.State.LSP.FormatOperations{ by_buffer: %{required(pid()) => reference()}, by_ref: %{required(reference()) => MingaEditor.State.LSP.FormatOperation.t()}, newest_first: [reference()] }
Functions
Drops an operation by request reference.
@spec fetch(t(), reference()) :: {:ok, MingaEditor.State.LSP.FormatOperation.t()} | :error
Fetches an operation by its external request reference.
@spec for_buffer(t(), pid()) :: MingaEditor.State.LSP.FormatOperation.t() | nil
Returns the operation for one Buffer.
@spec new() :: t()
Returns an empty operation collection.
@spec newest(t()) :: MingaEditor.State.LSP.FormatOperation.t() | nil
Returns the newest active operation.
@spec track(t(), MingaEditor.State.LSP.FormatOperation.t()) :: {:ok, t()} | {:error, :buffer_busy}
Tracks an operation when its Buffer has no current request.