Typed per-tab workspace snapshot stored on MingaEditor.State.Tab.
Contexts replace the old free-form map while still accepting legacy maps at API boundaries. present_fields records which workspace fields were actually present in a legacy map so partial migration inputs do not overwrite live workspace state with nil defaults.
Summary
Types
A document highlight range from the LSP server.
Workspace fields carried by a tab context.
Legacy map persisted or built before tab contexts became typed structs.
Functions
Returns an empty context for a brand-new tab with no saved workspace yet.
Returns true when the context has no workspace fields to restore.
Returns the workspace field names represented by this context.
Normalizes a legacy context map into a typed context struct.
Creates a tab context directly from a workspace struct, without intermediate map conversion.
Returns a context with valid workspace field overrides applied.
Returns a context with the dead buffer removed from its buffers snapshot when present.
Returns a workspace map containing only fields present in this context.
Types
@type document_highlight() :: Minga.LSP.DocumentHighlight.t()
A document highlight range from the LSP server.
@type field_name() ::
:keymap_scope
| :buffers
| :windows
| :dired
| :file_tree
| :viewport
| :mouse
| :highlight
| :lsp_pending
| :injection_ranges
| :search
| :editing
| :feature_state
| :document_highlights
| :agent_ui
Workspace fields carried by a tab context.
@type legacy() :: map()
Legacy map persisted or built before tab contexts became typed structs.
@type t() :: %MingaEditor.State.Tab.Context{ agent_ui: MingaEditor.Agent.UIState.t() | nil, buffers: MingaEditor.State.Buffers.t() | nil, dired: MingaEditor.State.Dired.t() | nil, document_highlights: [document_highlight()] | nil, editing: MingaEditor.VimState.t() | nil, feature_state: MingaEditor.FeatureState.t() | nil, file_tree: MingaEditor.State.FileTree.t() | nil, highlight: MingaEditor.State.Highlighting.t() | nil, injection_ranges: %{required(pid()) => [Minga.Language.Highlight.InjectionRange.t()]} | nil, keymap_scope: Minga.Keymap.Scope.scope_name() | nil, lsp_pending: %{required(reference()) => atom() | tuple()} | nil, mouse: MingaEditor.State.Mouse.t() | nil, present_fields: [field_name()], search: MingaEditor.State.Search.t() | nil, version: pos_integer(), viewport: MingaEditor.Viewport.t() | nil, windows: MingaEditor.State.Windows.t() | nil }
Functions
@spec empty() :: t()
Returns an empty context for a brand-new tab with no saved workspace yet.
Returns true when the context has no workspace fields to restore.
@spec field_names() :: [field_name()]
Returns the workspace field names represented by this context.
Normalizes a legacy context map into a typed context struct.
@spec from_workspace(MingaEditor.Session.State.t()) :: t()
Creates a tab context directly from a workspace struct, without intermediate map conversion.
Returns a context with valid workspace field overrides applied.
Returns a context with the dead buffer removed from its buffers snapshot when present.
Returns a workspace map containing only fields present in this context.