turbo-core
The library every Turbo editor is built on.
turbo-core is a Turbo C-style terminal IDE with a hole where the language goes: a menu bar, movable overlapping windows, modal dialogs, mouse support, loadable TOML themes, completion over LSP, terminal windows running a real shell, per-project settings, a project tree, snippets, and a menu of the commands a project runs on itself. None of it knows what language is being edited.
An editor built on it is a command, a profile.Profile, and a scanner:
- Turbo Go —
codeberg.org/turbo-editors/turbo-go - Turbo Rust —
codeberg.org/turbo-editors/turbo-rust - Turbo Python —
codeberg.org/turbo-editors/turbo-python - Turbo MoonBit —
codeberg.org/turbo-editors/turbo-moonbit - Turbo Golo —
codeberg.org/turbo-editors/turbo-golo - Turbo JS —
codeberg.org/turbo-editors/turbo-js
The whole of the difference
profile.Profile{
Name: "Turbo Rust",
Slug: "turbo-rust",
Language: "Rust",
ToolsMenu: "Rus~t~",
RootMarkers: []string{"Cargo.toml"},
Server: profile.Server{
Command: "rust-analyzer",
InstallHint: "rustup component add rust-analyzer",
Dirs: []string{cargoBinDir()},
},
Templates: profile.Templates{Settings: …, Snippets: …, Tools: …},
}
That, plus syntax.Register for the colouring, is everything Turbo Rust is that Turbo Go is not.
Getting started
Build an editor walks through a working IDE for a language of your own, in about eighty lines. It has been run start to finish.
go get codeberg.org/turbo-editors/turbo-core
Go 1.26.5 or later.
What is in it
Sixteen packages. Dependencies run strictly downwards, with no cycles and no interface indirection introduced to prevent one.
| Package | What it holds |
|---|---|
profile |
The editor's identity: name, slug, language server, starter templates |
buffer |
The text of one file: lines of runes, cursor, selection, undo, search |
projectfile |
Atomic writes of a project's own TOML files |
version |
What build of itself a binary is |
lsp |
LSP framing, JSON-RPC 2.0, the child process |
theme |
TOML into tcell styles; eleven embedded themes plus the user's own |
syntax |
Colouring for eight shared languages, the registry an editor adds its own to, and the scanner toolkit |
settings snippets tools |
A project's own three files |
ui |
Turbo Vision widgets: painter, desktop, window, menu, dialog, controls |
editor |
The editing widget: viewport, scrolling, keys, mouse |
terminal |
A shell in a window: pty, VT/ANSI emulator, the widget |
filetree |
A project's files as an expandable tree |
app |
Assembly: menus, dialogs, event routing, completion, the server's lifecycle |
Each has a README.md of its own. The dependency graph is drawn in docs/diagrams/packages.drawio.
Three third-party dependencies: tcell/v2 for the terminal, BurntSushi/toml for every configuration file, and golang.org/x/sys for the pty ioctls. The tokeniser, the JSON-RPC client, the LSP framing and the VT emulator are hand-written.
Build and test
make test # the whole suite — the single documented command
make race # the same under the race detector
make cover # statement coverage per package
make check # fmt, vet and test — what a commit should pass
make help # every target
Quality gate, separate from the tests:
python3 ~/.claude/skills/quality/scripts/quality_report.py --workspace .
Documentation
Full documentation in English and French, following Diátaxis:
- English — tutorial, five how-to guides, four reference pages, two explanations
- Français — le même, en français
Licence
MIT. See LICENSE.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|