How helix-editor/helix works
Helix is a terminal modal editor. The principal workflow is: a user launches hx, configuration and language resources load, the application runs an event loop, editor state is updated through modal actions and text transformations, and the compositor renders results to the terminal. Major branches include tree-sitter syntax support, LSP assistance, debugging through DAP, VCS integration, completion/pickers, and persistent document writes. Some subsystem links are inferred from documented capabilities and tree structure because their callers were not sampled.
Main entry points: application.rs Application Loop · main.rs CLI Entry · editor.rs Editor State · document.rs Document Model
Components 20
Entry and UI
- CLI Entry
helix-term/src/main.rs - Application Loop
helix-term/src/application.rs - Event Runtime
helix-event/src/runtime.rs - UI Compositor
helix-term/src/compositor.rs - Terminal Renderer
helix-tui/src/terminal.rs
Editing Engine
- Editor State
helix-view/src/editor.rs - Document Model
helix-view/src/document.rs - Editing Primitives
helix-core/src/lib.rs - Syntax Engine
helix-core/src/syntax.rs
Workspace Services
- Editor Config
helix-term/src/config.rs - Workspace Loader
helix-loader/src/lib.rs
Language Tools
- LSP Handlers
- LSP Client
helix-lsp/src/client.rs - LSP Protocol
helix-lsp-types/src/lib.rs - DAP Commands
helix-term/src/commands/dap.rs - DAP Client
helix-dap/src/client.rs
Project Tools
- VCS Integration
helix-vcs/src/lib.rs - Completion UI
helix-term/src/handlers/completion.rs - Picker Queries
helix-term/src/ui/picker/query.rs
Other components
- Editor User
Connections 20
- Editor User → CLI Entry: launches hx
- CLI Entry → Editor Config: loads config
- CLI Entry → Workspace Loader: loads resources
- CLI Entry → Application Loop: starts editor
- Application Loop → Editor State: creates editor
- Application Loop → UI Compositor: pushes view
- Application Loop → Event Runtime: awaits events
- Event Runtime → Application Loop: dispatches events
- Application Loop → Terminal Renderer: renders output
- Editor State → Document Model: updates documents
- Document Model → Editing Primitives: applies edits
- Document Model → Syntax Engine: provides text
- Application Loop → LSP Handlers: handles LSP events
- LSP Handlers → LSP Client: requests language features
- LSP Client → LSP Protocol: exchanges messages
- Application Loop → DAP Commands: dispatches debug commands
- DAP Commands → DAP Client: controls debugger
- Editor State → VCS Integration: reads project status
- LSP Handlers → Completion UI: updates completions
- Completion UI → Picker Queries: filters candidates