Skip to main content

Effect

Type Alias Effect 

Source
pub type Effect = Effect;

Aliased Type§

pub enum Effect {
Show 124 variants None, Declined, Edits(Vec<AppliedEdit>), ApplyEdit(ApplyEditPayload), WriteToFile(WriteToFilePayload), SelectionChange(SelectionSet), CursorMove(Position), Confirm(ConfirmPayload), OpenPrompt(OpenPromptPayload), OpenTransient(OpenTransientPayload), Yank(YankPayload), EnterMode(ModalState), SaveBuffer(Option<String>), QuitEditor(QuitPayload), OpenBuffer(OpenBufferPayload), OpenBufferAt(OpenBufferAtPayload), OpenExternalUri(String), OpenBufferAtColumn(OpenBufferAtColumnPayload), SpawnTerminal(SpawnTerminalPayload), TerminalInput(Vec<u8>), SetOption(String), SetLocalOption(String), SetGlobalOption(String), ClearSearchHighlight, SetColorscheme(String), Echo(EchoPayload), ShowDiagnosticsPopup(Vec<(String, u8)>), Lsp(LspRequest), EchoRegisters, EchoMarks, Substitute(SubstitutePayload), DeleteCurrentLine, DescribeCommand(DescribeCommandPayload), DescribeBuffer, Apropos(String), DescribeKey(String), ListKeymap, BufferNext, BufferPrev, ListBuffers, OpenBufferPicker, OpenPicker(OpenPickerPayload), BufferDelete(bool), OpenFileTree(Option<String>), CloseFileTree, OpenOil(Option<String>), DescribeOption(String), DescribeElement(String), ListOptions, DescribePluginApi(Option<String>), ListPluginApis, ExportPluginApi(Option<String>), ListCommands, DescribePlugin(String), ListPlugins, OpenHover(String), DismissPopup, DismissPopupNamed(String), OpenPopup(OpenPopupPayload), OpenHelpTopic(Option<String>), ListDiagnostics, NextDiagnostic, PrevDiagnostic, OpenLspLog(Option<String>), OpenMessages, OpenDashboard, ToggleLspTrace(String), OpenLspTraceLog(Option<String>), LspStatus, LspServerLogListing, LspRestart(String), LspProgressCancel(Option<String>), LspExpandRegion, LspShrinkRegion, SetLspLogLevel(SetLspLogLevelPayload), LspLogClear(Option<String>), LspDocumentSymbol, LspWorkspaceSymbol(String), LspIncomingCalls, LspOutgoingCalls, LspSupertypes, LspSubtypes, LspMoniker, LspCodeLens, LspColorPresentation, LspFormat, LspFormatRange, LspSignatureHelp, LspComplete, LspRename(String), LspCodeAction, ExpandSnippet(Range), ReloadSnippets, DescribeEvents, DescribeDiff, DiffOpen, DiffOff(bool), Diffthis, Diffsplit(DiffsplitPayload), DiffGetCmd(Option<u32>), DiffPutCmd(Option<u32>), DiffAccept, DiffReject, DiffAcceptAll, DiffRejectAll, CloseSessionDiffs(CloseSessionDiffsPayload), CloseAllSessionDiffs(u64), NextHunk, PrevHunk, DescribeEvent(String), ListModes, DescribeMode(String), DescribeActiveModes, DescribeActiveBindings, DescribeOptionResolution(String), Customize(Option<String>), Tutor(Option<u32>), ToggleMode(String), AppAction(AppEffect), RecordJump, OpenAiLog(Option<String>), OpenSyntheticBuffer(OpenSyntheticBufferPayload), FocusBuffer(u32), InvokeCommand(CommandRef),
}

Variants§

§

None

§

Declined

AP.0.2: the action DECLINES the chord (it did nothing) — the dispatcher re-resolves as if this action’s keymap layer weren’t there, falling through to the next binding. Distinct from none (a no-op that consumes the chord). A guest returns [declined] to fall through.

§

Edits(Vec<AppliedEdit>)

§

ApplyEdit(ApplyEditPayload)

§

WriteToFile(WriteToFilePayload)

XF.4: move text into another file. See write-to-file-payload.

§

SelectionChange(SelectionSet)

§

CursorMove(Position)

§

Confirm(ConfirmPayload)

IX.3: ask the user a yes/no question, then dispatch an action. Available to plugins because asking the user something is table stakes, not an advanced capability.

§

OpenPrompt(OpenPromptPayload)

IX.5: ask the user for a line of text, then dispatch an action with it. The other half of “a plugin can collect input” — without it a guest can only ask yes/no questions.

§

OpenTransient(OpenTransientPayload)

IX.6: open a named transient menu. The payload names the source the owning crate registered with the TransientSourceRegistry, not a menu structure — the menu is built host-side from that registration, so a guest opens its own menu by naming it rather than by shipping a spec across on every press.

TR.3a: it also carries the ARGUMENTS the open was requested with, which reach the builder as transient-context.args. Without them a menu cannot drill down — a row that opens a second menu has no way to say what it opened it FOR, and the builder would have to keep the answer in guest memory where nothing clears it.

§

Yank(YankPayload)

§

EnterMode(ModalState)

§

SaveBuffer(Option<String>)

§

QuitEditor(QuitPayload)

§

OpenBuffer(OpenBufferPayload)

§

OpenBufferAt(OpenBufferAtPayload)

§

OpenExternalUri(String)

§

OpenBufferAtColumn(OpenBufferAtColumnPayload)

§

SpawnTerminal(SpawnTerminalPayload)

§

TerminalInput(Vec<u8>)

§

SetOption(String)

§

SetLocalOption(String)

§

SetGlobalOption(String)

§

ClearSearchHighlight

§

SetColorscheme(String)

§

Echo(EchoPayload)

§

ShowDiagnosticsPopup(Vec<(String, u8)>)

§

Lsp(LspRequest)

§

EchoRegisters

§

EchoMarks

§

Substitute(SubstitutePayload)

§

DeleteCurrentLine

§

DescribeCommand(DescribeCommandPayload)

§

DescribeBuffer

§

Apropos(String)

§

DescribeKey(String)

§

ListKeymap

§

BufferNext

§

BufferPrev

§

ListBuffers

§

OpenBufferPicker

§

OpenPicker(OpenPickerPayload)

§

BufferDelete(bool)

§

OpenFileTree(Option<String>)

§

CloseFileTree

§

OpenOil(Option<String>)

§

DescribeOption(String)

§

DescribeElement(String)

§

ListOptions

§

DescribePluginApi(Option<String>)

PI.2: plugin-API introspection help effects.

§

ListPluginApis

§

ExportPluginApi(Option<String>)

§

ListCommands

§

DescribePlugin(String)

§

ListPlugins

§

OpenHover(String)

§

DismissPopup

§

DismissPopupNamed(String)

Dismiss the popup only if it is the named one; a no-op otherwise. dismiss-popup is the user’s verb (“close what I am looking at”); this is the one a mode uses when it dismisses on its own schedule, where the slot may hold someone else’s popup by the time the effect lands. See Effect::DismissPopupNamed for the bug that motivated it.

§

OpenPopup(OpenPopupPayload)

§

OpenHelpTopic(Option<String>)

§

ListDiagnostics

§

NextDiagnostic

§

PrevDiagnostic

§

OpenLspLog(Option<String>)

§

OpenMessages

§

OpenDashboard

§

ToggleLspTrace(String)

§

OpenLspTraceLog(Option<String>)

§

LspStatus

§

LspServerLogListing

§

LspRestart(String)

§

LspProgressCancel(Option<String>)

§

LspExpandRegion

§

LspShrinkRegion

§

SetLspLogLevel(SetLspLogLevelPayload)

§

LspLogClear(Option<String>)

§

LspDocumentSymbol

§

LspWorkspaceSymbol(String)

§

LspIncomingCalls

§

LspOutgoingCalls

§

LspSupertypes

§

LspSubtypes

§

LspMoniker

§

LspCodeLens

§

LspColorPresentation

§

LspFormat

§

LspFormatRange

§

LspSignatureHelp

§

LspComplete

§

LspRename(String)

§

LspCodeAction

§

ExpandSnippet(Range)

§

ReloadSnippets

§

DescribeEvents

§

DescribeDiff

§

DiffOpen

§

DiffOff(bool)

§

Diffthis

§

Diffsplit(DiffsplitPayload)

§

DiffGetCmd(Option<u32>)

§

DiffPutCmd(Option<u32>)

§

DiffAccept

§

DiffReject

§

DiffAcceptAll

§

DiffRejectAll

§

CloseSessionDiffs(CloseSessionDiffsPayload)

§

CloseAllSessionDiffs(u64)

§

NextHunk

§

PrevHunk

§

DescribeEvent(String)

§

ListModes

§

DescribeMode(String)

§

DescribeActiveModes

§

DescribeActiveBindings

§

DescribeOptionResolution(String)

§

Customize(Option<String>)

§

Tutor(Option<u32>)

§

ToggleMode(String)

§

AppAction(AppEffect)

§

RecordJump

§

OpenAiLog(Option<String>)

§

OpenSyntheticBuffer(OpenSyntheticBufferPayload)

§

FocusBuffer(u32)

CD.1: show the buffer with this id in the active pane. The peer of apply-edit’s target: a guest can edit a buffer it knows only by id, and this shows one. An id that no longer names a buffer is a no-op. Appended last so existing variant indices do not move.

§

InvokeCommand(CommandRef)

CD.3d: run a registered command — an action with typed args, else an ex line — AFTER the effects before it in the same batch. A write-to-file that does not land stops the batch, so work that must follow a successful write (deleting what was filed) goes here rather than in a host call, which runs before any effect is applied.