$ show helix-editor/helix
Helix is a modern, terminal-based text editor written in Rust, inspired by Kakoune and Neovim. It provides a modal editing experience with multiple cursors, tree-sitter syntax highlighting, and deep Language Server Protocol (LSP) integration for features like code completion, diagnostics, hover, and code actions. The editor also supports the Debug Adapter Protocol (DAP) for debugging, version control integration via git, and a flexible snippet system. Its architecture is a multi-crate Cargo workspace with a core editing engine (helix-core), a view/document abstraction layer (helix-view), a terminal UI framework (helix-tui), and a terminal application crate (helix-term) that ties everything together with an async event loop using tokio. The editor is highly configurable through TOML files and supports a vast number of programming languages via tree-sitter grammars and LSP servers. The codebase demonstrates strong engineering practices: clean separation of concerns across crates, extensive use of Rust's type system for safety, and a composable event-driven architecture. Notable reusable components include a standalone LSP type definitions crate (helix-lsp-types), a generic event/hook system (helix-event), a parser combinator library (helix-parsec), and a terminal UI widget library (helix-tui) that could be extracted for other TUI applications. The editor's picker UI component and command-line parser are also well-designed patterns. While there is some architectural debt (tight coupling between helix-term and other crates, some unsafe code for performance), the overall quality is high and the project is actively maintained with frequent releases.
The LLM identified 5 files worth highlighting for reuse:
Provides a generic event dispatch system with typed events, async hooks (AsyncHook trait), debouncing, and runtime-local storage (RuntimeLocal macro). The hook system uses a global registry with type erasure and manual vtable dispatch for efficiency. This crate is self-contained and could be reused in any async Rust application needing a decoupled event-driven architecture.
Defines all LSP protocol types as serde-serializable Rust structs, covering requests, notifications, and data structures (e.g., completion, diagnostics, code actions, semantic tokens). This crate is fully independent of the editor and can be used by any Rust project that needs to communicate with LSP servers.
A small, self-contained parser combinator library providing combinators like seq!, choice!, map, filter_map, one_or_more, sep, etc. It defines a Parser trait and supports error recovery. This crate is editor-agnostic and could be extracted for any parsing task.
A collection of small, reusable utility modules: Range (with inclusive/exclusive bounds), URI (RFC3986 with percent encoding), path normalization and tilde expansion, rope helpers (grapheme boundaries, character indices), and platform-specific file access checks. These are editor-agnostic and could be used in any Rust project.
A terminal UI widget library with backends (crossterm, termina, test), layout engine (cassowary constraint solver), and widgets (Block, Paragraph, Table, List, Gauge). It provides double-buffered rendering, styled text primitives, and a compositor pattern. While used by Helix, the crate is self-contained and could be extracted for other TUI applications.