MingaEditor.State.Parser (Minga v0.1.0)

Copy Markdown View Source

Parser connection and parser-derived presentation state.

Highlight caches, injection ranges, and per-buffer face registries are kept together so buffer retirement and parser availability transitions cannot leave one parser-derived surface behind.

Summary

Functions

Commits syntax-highlight presentation caches.

Commits live parser injection ranges.

Records the parser manager serving this editor.

Creates parser state for the configured parser manager.

Reconciles the face override registry associated with a buffer.

Records parser availability for editor presentation.

Drops every parser-derived presentation value associated with a buffer.

Types

face_override_registries()

@type face_override_registries() :: %{
  required(pid()) => MingaEditor.UI.Face.Registry.t()
}

injection_ranges()

@type injection_ranges() :: %{
  required(pid()) => [Minga.Language.Highlight.InjectionRange.t()]
}

status()

t()

@type t() :: %MingaEditor.State.Parser{
  face_override_registries: face_override_registries(),
  highlighting: MingaEditor.State.Highlighting.t(),
  injection_ranges: injection_ranges(),
  parser_manager: GenServer.server(),
  parser_status: status()
}

Functions

accept_highlighting(parser, highlighting)

@spec accept_highlighting(t(), MingaEditor.State.Highlighting.t()) :: t()

Commits syntax-highlight presentation caches.

accept_injection_ranges(parser, ranges)

@spec accept_injection_ranges(t(), injection_ranges()) :: t()

Commits live parser injection ranges.

connect_manager(parser, manager)

@spec connect_manager(t(), GenServer.server()) :: t()

Records the parser manager serving this editor.

new(parser_manager \\ Minga.Parser.Manager)

@spec new(GenServer.server()) :: t()

Creates parser state for the configured parser manager.

reconcile_face_overrides(parser, buffer_pid, registry)

@spec reconcile_face_overrides(t(), pid(), MingaEditor.UI.Face.Registry.t() | nil) ::
  t()

Reconciles the face override registry associated with a buffer.

report_status(parser, status)

@spec report_status(t(), status()) :: t()

Records parser availability for editor presentation.

retire_buffer(parser, buffer_pid)

@spec retire_buffer(t(), pid()) :: t()

Drops every parser-derived presentation value associated with a buffer.