MingaEditor.Extension.GitStatus (minga_sdk v0.1.2)

Copy Markdown View Source

Enables the native Git Status sidebar for an extension.

Minga owns the sidebar and its cached repository snapshot. Extensions own commit prompts and Git operations. The SDK declares the API for compilation; the editor provides the runtime.

Summary

Types

The displayed repository and last commit message, or why no target is available.

Functions

Shows Git Status and returns the exact displayed repository and last commit message.

Registers the unique native surface. Call this from the extension's init/1.

Opens, focuses, or closes Git Status. Does nothing when the surface is unavailable.

Types

commit_target()

@type commit_target() ::
  {:ok, String.t(), String.t() | nil} | :not_git | :repo_unavailable

The displayed repository and last commit message, or why no target is available.

Functions

prepare_commit(state)

Shows Git Status and returns the exact displayed repository and last commit message.

Returns :not_git outside a repository, or :repo_unavailable with a notice in the returned state when Git Status cannot provide a commit target.

register()

@spec register() :: :ok | {:error, term()}

Registers the unique native surface. Call this from the extension's init/1.

toggle(state)

Opens, focuses, or closes Git Status. Does nothing when the surface is unavailable.