turbo-editors/turbo-corepublic Fork
⑂ main
Commits
⬇ Clone ▾
git clone https://git.rickub.com/turbo-editors/turbo-core.git
git clone ssh://git@rickub.com/turbo-editors/turbo-core.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

README.md

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, a menu of the commands a project runs on itself, and editing another machine's files over ssh. 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 — rickub.com/turbo-editors/turbo-go
  • Turbo Rust — rickub.com/turbo-editors/turbo-rust
  • Turbo Python — rickub.com/turbo-editors/turbo-python
  • Turbo MoonBit — rickub.com/turbo-editors/turbo-moonbit
  • Turbo Golo — rickub.com/turbo-editors/turbo-golo
  • Turbo JS — rickub.com/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 rickub.com/turbo-editors/turbo-core

Go 1.26.5 or later.

What is in it

Twenty-one 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
fsys The one door to the project's files — the local disk, or another machine's after fsys.Use
remote Another machine over the ssh command: one shared connection, files over SFTP, remote shells and tools — every editor's -ssh user@machine[:dir]
configrepo A shared .turbo-<slug> directory fetched from a repository URL — rickub, GitHub, GitLab, Codeberg — by a shallow git clone
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 nine 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 — a tutorial, seven how-to guides, six reference pages, three explanations
  • Français — le même, en français

Licence

MIT. See LICENSE.