Lutra/crates/engine/src/cmd/mod.rs
danny fc8ae6c2e3 M4.4: Git gutter change markers and status colours in tree and tabs
- git.lineChanges {id} -> {ranges: [{kind, startLine, endLine}], version}:
  the buffer against its index blob, line diff with similar (Myers +
  Replace, no Compact) off the lock, CRLF-safe; index texts cached per
  path and dropped on gitChanged (State::emit -> git_lines::observe)
- editor gutter markers for added, modified and deleted lines, queried
  150 ms after edits, on show and on gitChanged, mapped through edits
- vcsStatus store (git.status on projectOpened and gitChanged, no
  polling) colouring file names in the project tree and editor tabs with
  the --lt-vcs-* tokens; contrast also checked on the active tab
- tests: unit and property tests, real-repo engine tests, Vitest
- docs: architecture, parity, gaps, roadmap, ui-parity, ROADMAP

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 17:40:30 +01:00

72 lines
2.5 KiB
Rust

//! Built-in commands, one module per area.
mod app;
mod buffer;
mod file;
pub mod git;
pub mod git_lines;
pub mod goto;
mod lsp_assist;
mod lsp_diagnostics;
mod lsp_nav;
mod params;
mod project;
mod recovery;
pub mod search;
mod settings;
pub mod syntax;
pub mod terminal;
pub mod theme;
pub mod toolchain;
pub mod ui;
use crate::{EngineError, Registry};
/// Registers every built-in command.
///
/// # Errors
/// Returns [`EngineError::Internal`] if two commands share an id.
pub fn register_builtins(registry: &mut Registry) -> Result<(), EngineError> {
registry.register(Box::new(app::About))?;
registry.register(Box::new(app::Quit))?;
registry.register(Box::new(project::Open))?;
registry.register(Box::new(project::OpenDialog))?;
registry.register(Box::new(project::Close))?;
registry.register(Box::new(project::Children))?;
registry.register(Box::new(file::Open))?;
registry.register(Box::new(file::Save))?;
registry.register(Box::new(file::SaveAll))?;
registry.register(Box::new(buffer::Get))?;
registry.register(Box::new(buffer::Edit))?;
registry.register(Box::new(buffer::Close))?;
registry.register(Box::new(recovery::List))?;
registry.register(Box::new(recovery::Restore))?;
registry.register(Box::new(recovery::Discard))?;
registry.register(Box::new(settings::List))?;
registry.register(Box::new(settings::Get))?;
registry.register(Box::new(settings::Set))?;
registry.register(Box::new(settings::Reset))?;
registry.register(Box::new(theme::List))?;
registry.register(Box::new(theme::SystemPreference))?;
registry.register(Box::new(ui::RegisterCommands))?;
registry.register(Box::new(search::Find))?;
registry.register(Box::new(search::Cancel))?;
registry.register(Box::new(goto::Status))?;
registry.register(Box::new(goto::File))?;
registry.register(Box::new(goto::Class))?;
registry.register(Box::new(goto::Symbol))?;
registry.register(Box::new(syntax::OutlineCommand))?;
registry.register(Box::new(toolchain::Status))?;
registry.register(Box::new(toolchain::DownloadPhpactor))?;
registry.register(Box::new(buffer::List))?;
registry.register(Box::new(terminal::Create))?;
registry.register(Box::new(terminal::Input))?;
registry.register(Box::new(terminal::Resize))?;
registry.register(Box::new(terminal::Close))?;
lsp_diagnostics::register(registry)?;
lsp_assist::register(registry)?;
lsp_nav::register(registry)?;
git::register(registry)?;
git_lines::register(registry)?;
Ok(())
}