Minga.Buffer (minga_sdk v0.1.0)

Copy Markdown View Source

Public API for buffer operations.

Extensions use this module to read buffer content, query cursor position, check file paths, and manage decorations.

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

Summary

Types

position()

@type position() :: {line :: non_neg_integer(), col :: non_neg_integer()}

t()

@type t() :: GenServer.server()

Functions

batch_decorations(server, fun)

@spec batch_decorations(t(), (term() -> term())) :: :ok

conflict_count(server)

@spec conflict_count(t()) :: non_neg_integer()

conflict_snapshot(server)

@spec conflict_snapshot(t()) :: {String.t(), position(), [term()]}

conflicts(server)

@spec conflicts(t()) :: [term()]

content(server)

@spec content(t()) :: String.t()

cursor(server)

@spec cursor(t()) :: position()

decorations(server)

@spec decorations(t()) :: term()

dirty?(server)

@spec dirty?(t()) :: boolean()

file_path(server)

@spec file_path(t()) :: String.t() | nil

filetype(server)

@spec filetype(t()) :: atom()

get_option(server, name)

@spec get_option(t(), atom()) :: term()

line_count(server)

@spec line_count(t()) :: pos_integer()

lines(server, start, count)

@spec lines(t(), non_neg_integer(), non_neg_integer()) :: [String.t()]

move_to(server, pos)

@spec move_to(t(), position()) :: :ok

read_only?(server)

@spec read_only?(t()) :: boolean()