Skip to main content

AcceptAction

Enum AcceptAction 

Source
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.

Fields

§path: PathBuf
§

SwitchBuffer

Activate buffer id in the current pane. First-party: :picker buffers.

Fields

§id: BufferId
§

JumpToFileLocation

Jump to (path, line, col) via App::jump_to_file_line_col. First-party: LSP references / definitions / type-defs / implementations / declaration / diagnostics.

Fields

§path: PathBuf
§line: u32
§col: u32
§

JumpInBuffer

Jump to (line, col) in an already-open buffer. First-party: :picker lines, :picker jumps.

Fields

§buffer_id: BufferId
§line: u32
§col: u32
§

InvokeCommand

Invoke ex-command id with args. First-party: :picker commands (the command palette).

Fields

§args: Args
§

PasteRegister

Paste named register name at the cursor. First-party: :picker registers.

Fields

§name: char
§

JumpToMark

Jump to mark name via App::do_jump_mark. First-party: :picker marks.

Fields

§name: char
§

ExpandSnippet

Expand snippet id at the cursor. First-party: :picker snippets.

Fields

§

OpenLspLog

Open *lsp:<server_id>* (the per-server log buffer) in the current pane. First-party: :lsp-log / :lsp-server-log picker.

Fields

§server_id: String
§workspace: PathBuf
§

OpenLspTraceLog

Open *lsp:<server_id>:trace* (the trace ring view) without flipping the trace toggle. First-party: :lsp-trace-log picker.

Fields

§server_id: String
§workspace: PathBuf
§

AcceptIndexedCompletion

Accept an LSP completion item from a pending request. First-party: :complete.

Fields

§index: u32
§

AcceptIndexedCodeAction

Accept an LSP code-action item. First-party: :code-actions / gA.

Fields

§index: u32
§

AcceptIndexedCodeLens

Accept an LSP code-lens item. First-party: :lsp-code-lens.

Fields

§index: u32
§

AcceptColorPresentation

Accept a color-presentation item. First-party: :lsp-color-presentation.

Fields

§index: u32
§

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.

Fields

§request_id: u32
§server_id: String
§index: u32
§

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.

Fields

§text: String
§replace_start: usize
§

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

Source§

fn clone(&self) -> AcceptAction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AcceptAction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for AcceptAction

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more