Minga.Extension.Overlay (minga_sdk v0.1.0)

Copy Markdown View Source

Registry for extension-owned overlays on the editor surface.

Extensions register overlays anchored to buffer positions. The editor reads this registry during rendering and displays the overlays on the appropriate frontend surface.

This is a compile-time stub. At runtime, the real module in Minga's BEAM VM provides the implementation.

Summary

Types

entry()

@type entry() :: %{
  extension: atom(),
  overlay_id: term(),
  buffer: pid(),
  position: {non_neg_integer(), non_neg_integer()},
  content: String.t(),
  style: style(),
  shape: shape()
}

shape()

@type shape() :: :cursor | :cursor_with_label | :label | :indicator

style()

@type style() :: %{optional(:fg) => non_neg_integer(), optional(:opacity) => 0..255}

Functions

all()

@spec all() :: [entry()]

empty?()

@spec empty?() :: boolean()

for_buffer(buffer_pid)

@spec for_buffer(pid()) :: [entry()]

remove(extension_name, overlay_id)

@spec remove(atom(), term()) :: :ok

remove_all(extension_name)

@spec remove_all(atom()) :: :ok

set(extension_name, overlay_id, buffer_pid, opts)

@spec set(atom(), term(), pid(), keyword()) :: :ok