Update Unison tree-sitter grammar for type changes and add indent queries (#9505)
* Update Unison tree-sitter grammar for type changes * Add indent queries for Unison * Improve Unison indent queries
This commit is contained in:
parent
75d61d8149
commit
6e3ed7f0fa
4 changed files with 18 additions and 5 deletions
|
@ -174,7 +174,7 @@
|
||||||
| typescript | ✓ | ✓ | ✓ | `typescript-language-server` |
|
| typescript | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||||
| typst | ✓ | | | `typst-lsp` |
|
| typst | ✓ | | | `typst-lsp` |
|
||||||
| ungrammar | ✓ | | | |
|
| ungrammar | ✓ | | | |
|
||||||
| unison | ✓ | | | |
|
| unison | ✓ | | ✓ | |
|
||||||
| uxntal | ✓ | | | |
|
| uxntal | ✓ | | | |
|
||||||
| v | ✓ | ✓ | ✓ | `v-analyzer` |
|
| v | ✓ | ✓ | ✓ | `v-analyzer` |
|
||||||
| vala | ✓ | | | `vala-language-server` |
|
| vala | ✓ | | | `vala-language-server` |
|
||||||
|
|
|
@ -2940,7 +2940,7 @@ indent = { tab-width = 4, unit = " " }
|
||||||
|
|
||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "unison"
|
name = "unison"
|
||||||
source = { git = "https://github.com/kylegoetz/tree-sitter-unison", rev = "aaec316774c8b50d367ec7cf26523aac5ef0cfc5" }
|
source = { git = "https://github.com/kylegoetz/tree-sitter-unison", rev = "1f505e2447fa876a87aee47ff3d70b9e141c744f" }
|
||||||
|
|
||||||
[[language]]
|
[[language]]
|
||||||
name = "todotxt"
|
name = "todotxt"
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
;; Keywords
|
;; Keywords
|
||||||
[
|
[
|
||||||
(kw_forall)
|
(kw_forall)
|
||||||
(unique_kw)
|
|
||||||
(structural_kw)
|
|
||||||
(type_kw)
|
(type_kw)
|
||||||
(kw_equals)
|
(kw_equals)
|
||||||
(do)
|
(do)
|
||||||
|
@ -51,7 +49,7 @@
|
||||||
(blank_pattern) @variable.builtin
|
(blank_pattern) @variable.builtin
|
||||||
|
|
||||||
;; Types
|
;; Types
|
||||||
(record_field name: (wordy_id) @variable.other.member type: (wordy_id) @type)
|
(record_field name: (wordy_id) @variable.other.member type: (_) @type)
|
||||||
(type_constructor (type_name (wordy_id) @constructor))
|
(type_constructor (type_name (wordy_id) @constructor))
|
||||||
(ability_declaration type_name: (wordy_id) @type type_arg: (wordy_id) @variable.parameter)
|
(ability_declaration type_name: (wordy_id) @type type_arg: (wordy_id) @variable.parameter)
|
||||||
(effect (wordy_id) @special) ;; NOTE: an effect is just like a type, but in signature we special case it
|
(effect (wordy_id) @special) ;; NOTE: an effect is just like a type, but in signature we special case it
|
||||||
|
|
15
runtime/queries/unison/indents.scm
Normal file
15
runtime/queries/unison/indents.scm
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
[
|
||||||
|
(term_definition)
|
||||||
|
(type_declaration)
|
||||||
|
(pattern)
|
||||||
|
(tuple_or_parenthesized)
|
||||||
|
(literal_list)
|
||||||
|
(tuple_pattern)
|
||||||
|
(function_application)
|
||||||
|
(exp_if)
|
||||||
|
(constructor)
|
||||||
|
(delay_block)
|
||||||
|
(type_signature)
|
||||||
|
] @indent
|
||||||
|
|
||||||
|
[(kw_then) (kw_else) (cases)] @indent.always @extend
|
Loading…
Add table
Reference in a new issue