Open
Description
Add a new tab that will contain a novel code editor.
This differs of the text area. The idea here is to have a text area that looks like a code editor (like this one: https://tree-sitter.github.io/tree-sitter/playground).
To do so, we will use tree-sitter:
- have an editable div (not a text area,
<div contenteditable="true">
) - Use the Java tree-sitter (https://tree-sitter.github.io//tree-sitter-java.wasm) parser in the app: https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md#setup
- Investigate whether tree-sitter can provide the changed elements of a modified AST (https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md#editing)
- Instead of having a linear undo history, investigate an undo history that undoes/redoes block of changed elements. For example if I write
int i = 0;
tree-sitter with produce the following AST. This will correspond to a main command composed of nested ones:type
that containsdeclarator
that containsname
andvalue
. So ctrl-Z will undovalue
first, thenname
, etc.
field_declaration [1, 1] - [1, 13]
type: integral_type [1, 1] - [1, 4]
declarator: variable_declarator [1, 5] - [1, 12]
name: identifier [1, 5] - [1, 8]
value: decimal_integer_literal [1, 11] - [1, 12]
Metadata
Metadata
Assignees
Labels
No labels