Skip to main content

Components and dependencies

Five library crates and two binaries. Each owns one kind of state; nothing is shared through globals.

CrateOwnsMust not
ide-textDocument text (rope), revisions, undo/redo history, dirty state, coordinate conversion, caret movement.Know about files, languages, widgets.
ide-languagesLanguage 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-extensionsManifest parsing and validation, discovery, compatibility, enablement.Execute extension code (format 1 is declarative).
ide-aiAI request/context model, providers, cancellation.Read files or documents; it receives explicit context.
ide-coreThe 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/desktopWindow, layout, input, painting, tabs, explorer expansion, dialogs, wiring of AI to the UI.Implement editing, file or language logic itself.
tools/perfBenchmarks 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-visible Notices. Panics are reserved for violated internal invariants.
  • unsafe is forbidden workspace-wide (unsafe_code = "forbid"). Unsafe code lives only inside reviewed dependencies.

Key third-party components​

PurposeCrateLicence
UIeframe/egui 0.38 (glow renderer)MIT OR Apache-2.0
Text storageropey 1.6MIT
Syntaxtree-sitter 0.27 with tree-sitter-rust 0.24, -typescript 0.23, -javascript 0.25MIT
LSPlsp-types 0.97, lsp-server 0.10 (framing only)MIT / MIT OR Apache-2.0
AI HTTPureq 3 (rustls)MIT OR Apache-2.0
Configserde, toml, semver, dirspermissive (see dependencies)