tree-sitter-rescript
tree-sitter-rescript copied to clipboard
add basic indents
This PR add basic support to indents.
Some cases that have not been implemented:
Variant
type user =
| Id
| Name
https://user-images.githubusercontent.com/16160544/153487870-596bf149-8c67-4cac-baeb-50668d369932.mp4
How to set the node/rule where indentation ends?
Labeled Variant Payloads (Inline Record)
| is the cursor
type user =
| Id
| Name({|})
Press enter:
type user =
| Id
| Name({
|
})
Here the indentation not work because Name({}) is a ERROR. record_type rule require a field
ERROR [0, 0] - [2, 12]
type_identifier [0, 5] - [0, 9]
variant_declaration [1, 4] - [1, 6]
variant_identifier [1, 4] - [1, 6]
variant_identifier [2, 4] - [2, 8]
Could record_type be an optional rule to not generate an ERROR node in the parser?