| 🛟 Updated. 28d5985 k33g 20h ago | 1 | # turbo-core |
| 2 | |
| 3 | The library every Turbo editor is built on. |
| 4 | |
| 5 | 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. |
| 6 | |
| 7 | An editor built on it is a command, a `profile.Profile`, and a scanner: |
| 8 | |
| 📦 Turbo Core d662ceb k33g 12h ago | 9 | - **[Turbo Go](https://rickub.com/turbo-editors/turbo-go)** — `codeberg.org/turbo-editors/turbo-go` |
| 🛟 Updated. 28d5985 k33g 20h ago | 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 |
| 19 | profile.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 | |
| 34 | That, 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 |
| 41 | go get codeberg.org/turbo-editors/turbo-core |
| 42 | ``` |
| 43 | |
| 44 | Go 1.26.5 or later. |
| 45 | |
| 46 | ## What is in it |
| 47 | |
| 48 | Sixteen 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 | |
| 66 | Each 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 |
| 73 | make test # the whole suite — the single documented command |
| 74 | make race # the same under the race detector |
| 75 | make cover # statement coverage per package |
| 76 | make check # fmt, vet and test — what a commit should pass |
| 77 | make help # every target |
| 78 | ``` |
| 79 | |
| 80 | Quality gate, separate from the tests: |
| 81 | |
| 82 | ```bash |
| 83 | python3 ~/.claude/skills/quality/scripts/quality_report.py --workspace . |
| 84 | ``` |
| 85 | |
| 86 | ## Documentation |
| 87 | |
| 88 | Full 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 | |
| 95 | MIT. See [LICENSE](LICENSE). |