pub struct CompilationMode;Expand description
Major mode for the *compilation* buffer.
Implementations§
Trait Implementations§
Source§impl Mode for CompilationMode
impl Mode for CompilationMode
Source§fn implies(&self) -> &[ModeId]
fn implies(&self) -> &[ModeId]
MG.RO: read-only-mode is where the operator gate actually is.
ReadOnly = true above stops Insert-mode TYPING and nothing else — it
is read by read_only_edit_rejected, which guards the char path, while
a Document’s grammar dispatch applies its own edits and hands the host
an already-applied Effect::Edits. So x deleted a character out of
this buffer while it reported itself read-only. Verified, not inferred.
read-only-mode carries the option AND the invocation_runner
(Editor::run_read_only_motion): motions move, : and / fall
through, mutating operators echo instead of silently editing. Declared
on the MAJOR because an implied mode is followed from the mode being
activated.
Source§fn keymap(&self) -> Keymap
fn keymap(&self) -> Keymap
<C-c> kill + <CR> jump-to-location. Resolved at host
translation time via CommandRegistry against the names
registered by lattice-host::actions::populate.
RV.2: gr is deliberately absent — see
Self::refresh_action.
Source§fn refresh_action(&self) -> Option<&'static str>
fn refresh_action(&self) -> Option<&'static str>
RV.2 (2026-08-10): recompile is this mode’s refresh.
The chord (gr) lives once on refreshable-view-mode, which the
implies cascade activates because this returns Some. The
handler body is unchanged — action:compilation-recompile is the
same command the mode’s own gr entry used to name directly.
See docs/dev/architecture/mode-architecture.md §5.5.
Source§fn fold_toggle_action(&self) -> Option<&'static str>
fn fold_toggle_action(&self) -> Option<&'static str>
OA.4b: this view folds by blocks, so <Tab> / <S-Tab> come from the
shared foldable-view-mode. Nothing special to do on a block, so it
names the generic body.
Source§fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
CM.3c: severity gutter marks for the *compilation* buffer. Reads
the per-buffer severity index the renderer injected as
[CompilationSeverityData] — produced off-thread by the drain,
delivered through render_state (never scanned at paint time) —
and maps each (line, level) to a leftmost-gutter
[GutterDecoration::Severity], the SAME column LSP diagnostics
paint (so no renderer edit is needed). Graceful empty when the
service is absent (no marks produced yet, or a stripped render
path). O(entries), no allocation proportional to buffer size.
Source§type Guard = CompilationModeGuard
type Guard = CompilationModeGuard
Self::on_activate]. Read moreSource§fn kind(&self) -> ModeKind
fn kind(&self) -> ModeKind
activate_major on a minor, or vice versa, is
[ModeActivationError::WrongKind]).Source§fn options(&self) -> OptionOverrideSet
fn options(&self) -> OptionOverrideSet
lattice_config::overrides! { lattice_config::Wrap = true, … }.Source§fn required_capabilities(&self) -> CapabilitySet
fn required_capabilities(&self) -> CapabilitySet
ModeActivationError::MissingCapability], never silent
skip.Source§fn on_activate(&self, ctx: ModeContext) -> LifecycleFuture<'_, Self::Guard>
fn on_activate(&self, ctx: ModeContext) -> LifecycleFuture<'_, Self::Guard>
Guard
carrying every resource the mode allocated. The
dispatcher stashes the Guard until deactivation, at which
point dropping it performs cleanup via the Guard’s Drop
impl. Read more§fn target_buffer_kind(&self) -> Option<BufferKind>
fn target_buffer_kind(&self) -> Option<BufferKind>
BufferKind] this mode is the default
major for (H.2, 2026-05-31). ModeRegistry::register
indexes this so
ModeRegistry::find_major_for_kind can
dispatch buffer-creation events to the right major without
host-side match BufferKind { ... } blocks. Read more§fn target_language(&self) -> Option<&str>
fn target_language(&self) -> Option<&str>
Lang::name() —
"rust", "org") (OM.1). The peer of
target_buffer_kind for the
dispatch path [BufferKind::Document] takes: language
detection rather than kind dispatch. Read more§fn decorations(&self) -> Vec<DecorationProvider>
fn decorations(&self) -> Vec<DecorationProvider>
§fn completion_sources(&self) -> Vec<CompletionSourceContribution>
fn completion_sources(&self) -> Vec<CompletionSourceContribution>
lsp-completion-mode,
snippet-completion-mode, buffer-words-mode,
tree-sitter-completion-mode, path-completion-mode,
plugin sources) override.§fn action_handlers(&self) -> Vec<ActionHandlerContribution>
fn action_handlers(&self) -> Vec<ActionHandlerContribution>
action_handlers() once at boot, resolves each
action_name → CommandId, registers the handler in the
ActionHandlerRegistry, and holds the tokens for the app’s
lifetime. Use this for handlers that read the active
buffer / cursor / services from the ActionContext at call
time and close over no per-buffer state (e.g. snippet
expand). Per-buffer, session-scoped handlers register in
on_activate instead, so their tokens
drop with the Guard. Default: none. See
feedback_effect_vocabulary_is_host_boundary.§fn conflicts_with(&self) -> &[ModeId]
fn conflicts_with(&self) -> &[ModeId]
§fn presents_extensions(&self) -> &[&'static str]
fn presents_extensions(&self) -> &[&'static str]
§fn mirrors_option(&self) -> Option<&'static str>
fn mirrors_option(&self) -> Option<&'static str>
Some(canonical_name) ⇒ a host-driven cascade keeps the
mode’s active state and the option’s value in sync.§fn invocation_runner(&self) -> Option<ModeId>
fn invocation_runner(&self) -> Option<ModeId>
ModeId]; the host registers a
runner function under that id at boot, and
Editor::run_invocation looks it up by walking the
active modes on the active pane’s buffer (minors first,
then major) before falling back to the central grammar
Action gate. Read more§fn refresh_on_open(&self) -> bool
fn refresh_on_open(&self) -> bool
§fn activation_policy(&self) -> ActivationPolicy
fn activation_policy(&self) -> ActivationPolicy
admits the entered major. The
default is [ActivationPolicy::Manual] — auto-activate
nowhere until the mode or the user opts in. Ignored for major
modes (a buffer’s major is chosen by the major resolver, not
this allowlist).§fn editable_tail(&self) -> Option<EditableTail>
fn editable_tail(&self) -> Option<EditableTail>
None (the default) for a fully read-only / fully writable buffer
(AU‑3). Read moreAuto Trait Implementations§
impl Freeze for CompilationMode
impl RefUnwindSafe for CompilationMode
impl Send for CompilationMode
impl Sync for CompilationMode
impl Unpin for CompilationMode
impl UnsafeUnpin for CompilationMode
impl UnwindSafe for CompilationMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<M> DynMode for Mwhere
M: Mode,
impl<M> DynMode for Mwhere
M: Mode,
§fn target_buffer_kind(&self) -> Option<BufferKind>
fn target_buffer_kind(&self) -> Option<BufferKind>
Mode::target_buffer_kind].§fn target_language(&self) -> Option<&str>
fn target_language(&self) -> Option<&str>
Mode::target_language].§fn decorations(&self) -> Vec<DecorationProvider>
fn decorations(&self) -> Vec<DecorationProvider>
Mode::decorations].§fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
Mode::gutter_decorations].§fn completion_sources(&self) -> Vec<CompletionSourceContribution>
fn completion_sources(&self) -> Vec<CompletionSourceContribution>
Mode::completion_sources].§fn action_handlers(&self) -> Vec<ActionHandlerContribution>
fn action_handlers(&self) -> Vec<ActionHandlerContribution>
Mode::action_handlers].§fn required_capabilities(&self) -> CapabilitySet
fn required_capabilities(&self) -> CapabilitySet
Mode::required_capabilities].§fn conflicts_with(&self) -> &[ModeId]
fn conflicts_with(&self) -> &[ModeId]
Mode::conflicts_with].§fn presents_extensions(&self) -> &[&'static str]
fn presents_extensions(&self) -> &[&'static str]
Mode::presents_extensions].§fn mirrors_option(&self) -> Option<&'static str>
fn mirrors_option(&self) -> Option<&'static str>
Mode::mirrors_option].§fn invocation_runner(&self) -> Option<ModeId>
fn invocation_runner(&self) -> Option<ModeId>
Mode::invocation_runner].§fn refresh_action(&self) -> Option<&'static str>
fn refresh_action(&self) -> Option<&'static str>
Mode::refresh_action].§fn fold_toggle_action(&self) -> Option<&'static str>
fn fold_toggle_action(&self) -> Option<&'static str>
Mode::fold_toggle_action].§fn refresh_on_open(&self) -> bool
fn refresh_on_open(&self) -> bool
Mode::refresh_on_open].§fn activation_policy(&self) -> ActivationPolicy
fn activation_policy(&self) -> ActivationPolicy
Mode::activation_policy].§fn editable_tail(&self) -> Option<EditableTail>
fn editable_tail(&self) -> Option<EditableTail>
Mode::editable_tail].§fn on_activate_dyn<'a>(
&'a self,
ctx: ModeContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>, ModeActivationError>> + Send + 'a>>
fn on_activate_dyn<'a>( &'a self, ctx: ModeContext, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>, ModeActivationError>> + Send + 'a>>
Box<dyn Any + Send>.
The dispatcher stashes this box keyed by
(BufferId, ModeId); deactivation drops it.