Components and dependencies
Five library crates and two binaries. Each owns one kind of state; nothing is shared through globals.
| Crate | Owns | Must not |
|---|---|---|
ide-text | Document text (rope), revisions, undo/redo history, dirty state, coordinate conversion, caret movement. | Know about files, languages, widgets. |
ide-languages | Language registry, Tree-sitter grammars and syntax trees, the capability contract, LSP processes and their lifecycle. | Decide trust, own document text, depend on the UI. |
ide-extensions | Manifest parsing and validation, discovery, compatibility, enablement. | Execute extension code (format 1 is declarative). |
ide-ai | AI request/context model, providers, cancellation. | Read files or documents; it receives explicit context. |
ide-core | The session: workspace and file tree, trust, open documents and their files, settings, profiles, themes, decorations, commands, and the bridge to language services. | Depend on egui or on ide-ai. |
apps/desktop | Window, layout, input, painting, tabs, explorer expansion, dialogs, wiring of AI to the UI. | Implement editing, file or language logic itself. |
tools/perf | Benchmarks of the core. | Ship to users. |
Rules
- Dependencies point downwards only. A new crate needs an ADR and a real feature that justifies it; traits alone do not.
- UI state (tab order, explorer expansion, scroll position, dialogs) stays in the app. Document state (text, selection, diagnostics) stays in the core so a future second view or a headless client sees the same truth.
- Threads are explicit: each language server has reader, writer and stderr threads; each AI request has one thread. They communicate with the UI thread through channels and a waker callback that requests a repaint. There is no async runtime.
- Errors are values. Library code returns
Result; the session converts failures into user-visibleNotices. Panics are reserved for violated internal invariants. unsafeis forbidden workspace-wide (unsafe_code = "forbid"). Unsafe code lives only inside reviewed dependencies.
Key third-party components
| Purpose | Crate | Licence |
|---|---|---|
| UI | eframe/egui 0.38 (glow renderer) | MIT OR Apache-2.0 |
| Text storage | ropey 1.6 | MIT |
| Syntax | tree-sitter 0.27 with tree-sitter-rust 0.24, -typescript 0.23, -javascript 0.25 | MIT |
| LSP | lsp-types 0.97, lsp-server 0.10 (framing only) | MIT / MIT OR Apache-2.0 |
| AI HTTP | ureq 3 (rustls) | MIT OR Apache-2.0 |
| Config | serde, toml, semver, dirs | permissive (see dependencies) |