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