Contract for synchronous runtime editor events declared by an extension.
Returning :not_matched means the callback ran successfully and declined an
editor action. Callback failures are reported by the host runtime and are not
represented by this successful callback return type.
Summary
Types
A successful state transition or explicit decline.
Runtime editor events available to SDK consumers.
Runtime editor event categories available in the public DSL.
Callbacks
Handles one runtime editor event synchronously.
Types
@type callback_result() :: {:handled, state :: term()} | :not_matched
A successful state transition or explicit decline.
@type event() :: {:buffer_saved, pid()} | {:editor_action, atom(), term()} | {:source_unload, {:extension, atom()}}
Runtime editor events available to SDK consumers.
@type event_kind() :: :buffer_saved | :editor_action | :source_unload
Runtime editor event categories available in the public DSL.
Callbacks
@callback handle_editor_event(state :: term(), event()) :: callback_result()
Handles one runtime editor event synchronously.