turbo-editors/turbo-corepublic Fork 0
v0.9.0
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.

🛟 Updated. 28d5985 · on v0.9.0 · k33g · 16h ago
packages.md · 59 lines · 3.5 KBmarkdown
Blame HistoryOpen raw

Reference: packages

Neutral, exhaustive description of what turbo-core holds.

Eighteen packages. Dependencies run strictly downwards; there are no cycles and no interface indirection to prevent one.

app → {editor, ui, lsp, buffer, terminal, filetree, settings, snippets, tools, syntax, theme, profile, version}
       editor   → {buffer, syntax, ui, theme}
       terminal → {ui, theme, tcell, golang.org/x/sys}
       filetree → {ui, theme, tcell}
       snippets → {toml, projectfile, profile}
       settings → {toml, projectfile, profile}
       tools    → {toml, projectfile, profile}
       syntax   → theme
       ui       → theme
       theme    → {profile-free; takes a directory}, tcell, toml
       lsp      → profile
Package What it holds Depends on
profile The editor's identity: name, slug, language server, starter templates, and the paths derived from them stdlib only
buffer The text of one file: lines of runes, cursor, selection, undo, search, load and save stdlib only
projectfile Atomic writes of the TOML files a project keeps in the editor's own directory stdlib only
version What build of itself a binary is: linker stamp, then Go build info stdlib only
jsonrpc JSON-RPC 2.0 over a framed stream: calls, notifications, inbound requests answerable later stdlib only
lsp LSP framing, the methods, and the child process jsonrpc, profile
theme TOML into tcell styles; eleven embedded themes plus the user's own; two kinds of inheritance tcell, toml
syntax Colouring: eight built-in languages, the registry an editor adds its own to, and the scanner toolkit theme
settings A project's settings.toml: load, create, rewrite one key in place toml, projectfile, profile
snippets Reusable text from a project's and a user's snippets.toml, grouped for a menu toml, projectfile, profile
tools The commands a project runs on itself, and which menu each is in toml, projectfile, profile
ui Turbo Vision widgets: painter, desktop, window, menu, dialog, controls, status bar theme, tcell
editor The editing widget: viewport, scrolling, keys, mouse, snippet insertion buffer, syntax, theme, ui
terminal A shell in a window: pseudo-terminal, VT/ANSI emulator, screen grid, the widget theme, ui, tcell, golang.org/x/sys
filetree A project's files as an expandable tree, and the window showing it theme, ui, tcell
acp A coding agent in a window: the Agent Client Protocol, the conversation, the widget jsonrpc, profile, projectfile, syntax, theme, ui, tcell, toml
app Assembly: menus, dialogs, event routing, completion popup, language-server lifecycle all of the above

Third-party dependencies

Three, and only three:

Module Why
github.com/gdamore/tcell/v2 the terminal
github.com/BurntSushi/toml every configuration file the editor reads
golang.org/x/sys the pseudo-terminal ioctls on Linux and macOS; the pseudo-console, process and job-object calls on Windows

The tokeniser, the JSON-RPC client, the LSP framing and the VT/ANSI emulator are hand-written.

The diagram

docs/diagrams/packages.drawio holds the same graph in draw.io format, checked against go list -deps.

See also

 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
# Reference: packages

> Neutral, exhaustive description of what turbo-core holds.

Eighteen packages. Dependencies run strictly downwards; there are no cycles and no interface indirection to prevent one.

```
app → {editor, ui, lsp, buffer, terminal, filetree, settings, snippets, tools, syntax, theme, profile, version}
       editor   → {buffer, syntax, ui, theme}
       terminal → {ui, theme, tcell, golang.org/x/sys}
       filetree → {ui, theme, tcell}
       snippets → {toml, projectfile, profile}
       settings → {toml, projectfile, profile}
       tools    → {toml, projectfile, profile}
       syntax   → theme
       ui       → theme
       theme    → {profile-free; takes a directory}, tcell, toml
       lsp      → profile
```

| Package | What it holds | Depends on |
| --- | --- | --- |
| `profile` | The editor's identity: name, slug, language server, starter templates, and the paths derived from them | **stdlib only** |
| `buffer` | The text of one file: lines of runes, cursor, selection, undo, search, load and save | **stdlib only** |
| `projectfile` | Atomic writes of the TOML files a project keeps in the editor's own directory | **stdlib only** |
| `version` | What build of itself a binary is: linker stamp, then Go build info | **stdlib only** |
| `jsonrpc` | JSON-RPC 2.0 over a framed stream: calls, notifications, inbound requests answerable later | **stdlib only** |
| `lsp` | LSP framing, the methods, and the child process | `jsonrpc`, `profile` |
| `theme` | TOML into tcell styles; eleven embedded themes plus the user's own; two kinds of inheritance | `tcell`, `toml` |
| `syntax` | Colouring: eight built-in languages, the registry an editor adds its own to, and the scanner toolkit | `theme` |
| `settings` | A project's `settings.toml`: load, create, rewrite one key in place | `toml`, `projectfile`, `profile` |
| `snippets` | Reusable text from a project's and a user's `snippets.toml`, grouped for a menu | `toml`, `projectfile`, `profile` |
| `tools` | The commands a project runs on itself, and which menu each is in | `toml`, `projectfile`, `profile` |
| `ui` | Turbo Vision widgets: painter, desktop, window, menu, dialog, controls, status bar | `theme`, `tcell` |
| `editor` | The editing widget: viewport, scrolling, keys, mouse, snippet insertion | `buffer`, `syntax`, `theme`, `ui` |
| `terminal` | A shell in a window: pseudo-terminal, VT/ANSI emulator, screen grid, the widget | `theme`, `ui`, `tcell`, `golang.org/x/sys` |
| `filetree` | A project's files as an expandable tree, and the window showing it | `theme`, `ui`, `tcell` |
| `acp` | A coding agent in a window: the Agent Client Protocol, the conversation, the widget | `jsonrpc`, `profile`, `projectfile`, `syntax`, `theme`, `ui`, `tcell`, `toml` |
| `app` | Assembly: menus, dialogs, event routing, completion popup, language-server lifecycle | all of the above |

## Third-party dependencies

Three, and only three:

| Module | Why |
| --- | --- |
| `github.com/gdamore/tcell/v2` | the terminal |
| `github.com/BurntSushi/toml` | every configuration file the editor reads |
| `golang.org/x/sys` | the pseudo-terminal ioctls on Linux and macOS; the pseudo-console, process and job-object calls on Windows |

The tokeniser, the JSON-RPC client, the LSP framing and the VT/ANSI emulator are hand-written.

## The diagram

`docs/diagrams/packages.drawio` holds the same graph in draw.io format, checked against `go list -deps`.

## See also

- Why the graph is shaped this way: [architecture](../explanation/architecture.md)