Crate: editors/code. Opens any File{Text} node; lowest priority so specialised editors (markdown WYSIWYG, flow) win for their kinds, with “Open with…” to override.

Architecture

Languages (initial)

LanguageGrammarLSPWhy first
Rusttree-sitter-rustrust-analyzerdogfooding
Juliatree-sitter-juliaLanguageServer.jlhost of Flow Editor targets (Lux.jl, MTK)
Gotree-sitter-gogoplsmature, simple
Unisoncommunity grammar (verify)ucmdatabase-backed codebase = a natural Source
Lean 4tree-sitter-lean (verify)lake serveinfoview as an extra panel

Each is a LanguageContribution in editors/code/src/languages/, proving the contribution point works (Example - Language).

Features by phase

  1. Open/edit/save, highlighting from tree-sitter, folding, search.
  2. LSP: diagnostics, hover, completion, go-to-definition (which is a graph edge!), references.
  3. Semantic tokens, inlay hints, code actions, format.
  4. “Show AST”, “show call graph of this function” → open a GraphView in the Graph View.

Big cases

Backend chosen by measured size — see Case Selector (design).

Unicode input

\name → symbol with a dropdown, in this editor and every other input: Unicode Input (design, not built).

Unison note

Unison stores code in a codebase DB, not files. A UnisonSource extension (definitions as nodes, dependency edges) would make Moonkale one of the few editors that shows Unison the way Unison thinks. Good showcase; later phase.

Designs not built yet

Removed from editors/code/src as comment-only files in Milestone 18 phase 1:

  • Decorations (decorations.rs) in a neutral form — Highlight { range, token }, Fold, Diagnostic, InlayHint, Gutter — produced by the index/LSP and consumed by any backend. Today diagnostics and wiki-link marks go to CodeMirror in their own messages, and highlighting is the bundle’s (P-093).
  • Document (document.rs): rope + version + undo stack + node id, turning backend edits into core patches and applying incoming changes (external change → reconcile or prompt). Today ext-api::Document holds a String and the view owns undo.
  • A Rust-native backend (backend/native.rs): a virtualised Dioxus text view or a wgpu text renderer over the same rope and decorations. The Rust editor that exists (Code Editor Implementations) is a separate extension on dioxus-code-editor, not this backend.