pub enum AcceptAction {
Show 17 variants
OpenFile {
path: PathBuf,
},
SwitchBuffer {
id: BufferId,
},
JumpToFileLocation {
path: PathBuf,
line: u32,
col: u32,
},
JumpInBuffer {
buffer_id: BufferId,
line: u32,
col: u32,
},
InvokeCommand {
id: String,
args: Args,
},
PasteRegister {
name: char,
},
JumpToMark {
name: char,
},
ExpandSnippet {
id: String,
},
OpenLspLog {
server_id: String,
workspace: PathBuf,
},
OpenLspTraceLog {
server_id: String,
workspace: PathBuf,
},
AcceptIndexedCompletion {
token: AcceptToken,
index: u32,
},
AcceptIndexedCodeAction {
token: AcceptToken,
index: u32,
},
AcceptIndexedCodeLens {
token: AcceptToken,
index: u32,
},
AcceptColorPresentation {
token: AcceptToken,
index: u32,
},
AcceptShowMessageAction {
request_id: u32,
server_id: String,
index: u32,
},
InsertText {
text: String,
replace_start: usize,
},
Custom(CustomAcceptPayload),
}Expand description
What the host should do when the user accepts a candidate.
Cleanup-and-rename of today’s lattice_picker::RoutingPayload
plus new variants for cmdline-completion (InsertText) and
plugin extensibility (Custom).
Stateless variants carry the full payload — no host lookup required. The accept handler returns one of these directly; the host’s dispatch arm reads the payload and runs the action.
Stateful variants carry an AcceptToken (opaque marker
the host uses to find the right pending_* table) plus an
index. The host’s dispatch arm resolves the token to a
pending-table reference, looks up the item by index,
applies it.
Custom is the plugin escape hatch — the plugin’s accept
handler returns Custom(Box::new(MyType { ... })); the
plugin’s matching dispatch handler downcasts to MyType
and applies its own logic.
Variants§
OpenFile
Hand path to App::do_edit(Some(path), false).
First-party: :picker files, :picker recent.
SwitchBuffer
Activate buffer id in the current pane.
First-party: :picker buffers.
Fields
id: BufferIdJumpToFileLocation
Jump to (path, line, col) via App::jump_to_file_line_col.
First-party: LSP references / definitions / type-defs /
implementations / declaration / diagnostics.
JumpInBuffer
Jump to (line, col) in an already-open buffer.
First-party: :picker lines, :picker jumps.
InvokeCommand
Invoke ex-command id with args.
First-party: :picker commands (the command palette).
PasteRegister
Paste named register name at the cursor.
First-party: :picker registers.
JumpToMark
Jump to mark name via App::do_jump_mark.
First-party: :picker marks.
ExpandSnippet
Expand snippet id at the cursor.
First-party: :picker snippets.
OpenLspLog
Open *lsp:<server_id>* (the per-server log buffer) in
the current pane.
First-party: :lsp-log / :lsp-server-log picker.
OpenLspTraceLog
Open *lsp:<server_id>:trace* (the trace ring view)
without flipping the trace toggle.
First-party: :lsp-trace-log picker.
AcceptIndexedCompletion
Accept an LSP completion item from a pending request.
First-party: :complete.
AcceptIndexedCodeAction
Accept an LSP code-action item.
First-party: :code-actions / gA.
AcceptIndexedCodeLens
Accept an LSP code-lens item.
First-party: :lsp-code-lens.
AcceptColorPresentation
Accept a color-presentation item.
First-party: :lsp-color-presentation.
AcceptShowMessageAction
Reply to a server-initiated window/showMessageRequest
with the selected action index. Host looks up the
pending oneshot by request_id on server_id.
InsertText
Replace cmdline[replace_start..] with text. Used by
the cmdline-completion popup when the user presses
<CR> on a candidate. Currently handled inline in
Editor::do_command_line_accept_completion — this
variant moves that logic into the unified action enum so
plugin-registered cmdline sources can use the same
dispatch path.
Custom(CustomAcceptPayload)
Plugin-defined opaque payload. The plugin’s accept
handler returns Custom(...); the plugin’s matching
dispatch handler (registered alongside the source)
downcasts to its known type and applies its own logic.
Trait Implementations§
Source§impl Clone for AcceptAction
impl Clone for AcceptAction
Source§fn clone(&self) -> AcceptAction
fn clone(&self) -> AcceptAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more