summaryrefslogtreecommitdiff
path: root/docs/architecture.md
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-11 10:46:58 +0000
committerBlaž Hrastnik2021-05-11 10:46:58 +0000
commite1dc1d2d48281ed08f52ef6009cadeb86d130ed7 (patch)
tree8971a7d87521be6decf04284aee326481d6ada1e /docs/architecture.md
parentf6d0c7a995c76b0937880dfe6aa1741faff283f0 (diff)
Fix release packaging.
Diffstat (limited to 'docs/architecture.md')
-rw-r--r--docs/architecture.md75
1 files changed, 75 insertions, 0 deletions
diff --git a/docs/architecture.md b/docs/architecture.md
new file mode 100644
index 00000000..13cdab5e
--- /dev/null
+++ b/docs/architecture.md
@@ -0,0 +1,75 @@
+
+| Crate | Description |
+| ----------- | ----------- |
+| helix-core | Core editing primitives, functional. |
+| helix-syntax | Tree-sitter grammars |
+| helix-lsp | Language server client |
+| helix-view | UI abstractions for use in backends, imperative shell. |
+| helix-term | Terminal UI |
+| helix-tui | TUI primitives, forked from tui-rs, inspired by Cursive |
+
+# Notes
+
+- server-client architecture via gRPC, UI separate from core
+- multi cursor based editing and slicing
+- WASM based plugins (builtin LSP & fuzzy file finder)
+
+Structure similar to codemirror:
+
+- text (ropes)
+- transactions
+ - changes
+ - invert changes (generates a revert)
+ - annotations (time changed etc)
+ - state effects
+ - additional editor state as facets
+- snapshots as an async view into current state
+- selections { anchor (nonmoving), head (moving) from/to } -> SelectionSet with a primary
+ - cursor is just a single range selection
+- markers
+ track a position inside text that synchronizes with edits
+- { doc, selection, update(), splice, changes(), facets, tabSize, identUnit, lineSeparator, changeFilter/transactionFilter to modify stuff before }
+- view (actual UI)
+- viewport(Lines) -> what's actually visible
+- extend the view via Decorations (inline styling) or Components (UI)
+ - mark / wieget / line / replace decoration
+- commands (transform state)
+- movement
+- selection extension
+- deletion
+- indentation
+- keymap (maps keys to commands)
+- history (undo tree via immutable ropes)
+ - undoes transactions via reverts
+- (collab mode)
+- gutter (line numbers, diagnostic marker, etc) -> ties into UI components
+- rangeset/span -> mappable over changes (can be a marker primitive?)
+- syntax (treesitter)
+- fold
+- selections (select mode/multiselect)
+- matchbrackets
+- closebrackets
+- special-chars (shows dots etc for specials)
+- panel (for UI: file pickers, search dialogs, etc)
+- tooltip (for UI)
+- search (regex)
+- lint (async linters)
+- lsp
+- highlight
+- stream-syntax
+- autocomplete
+- comment (gc, etc for auto commenting)
+- snippets
+- terminal mode?
+
+- plugins can contain more commands/ui abstractions to use elsewhere
+- languageData as presets for each language (syntax, indent, comment, etc)
+
+Vim stuff:
+- motions/operators/text objects
+- full visual mode
+- macros
+- jump lists
+- marks
+- yank/paste
+- conceal for markdown markers, etc