mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-24 02:16:18 +04:00
update to newest rescript treesitter library and queries (#11165)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com> Co-authored-by: Freddie Ridell <freddie@Gilbraith-MacBook-Pro.local>
This commit is contained in:
parent
4e2faa0be9
commit
07968880e6
@ -1825,7 +1825,7 @@ indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[grammar]]
|
||||
name = "rescript"
|
||||
source = { git = "https://github.com/jaredramirez/tree-sitter-rescript", rev = "467dcf99f68c47823d7b378779a6b282d7ef9782" }
|
||||
source = { git = "https://github.com/rescript-lang/tree-sitter-rescript", rev = "5e2a44a9d886b0a509f5bfd0437d33b4871fbac5" }
|
||||
|
||||
[[language]]
|
||||
name = "erlang"
|
||||
|
@ -10,11 +10,10 @@
|
||||
[
|
||||
(type_identifier)
|
||||
(unit_type)
|
||||
(list)
|
||||
(list_pattern)
|
||||
] @type
|
||||
|
||||
(list ["list{" "}"] @type)
|
||||
(list_pattern ["list{" "}"] @type)
|
||||
|
||||
[
|
||||
(variant_identifier)
|
||||
(polyvar_identifier)
|
||||
@ -72,14 +71,16 @@
|
||||
; single parameter with no parens
|
||||
(function parameter: (value_identifier) @variable.parameter)
|
||||
|
||||
; first-level descructuring (required for nvim-tree-sitter as it only matches direct
|
||||
; children and the above patterns do not match destructuring patterns in NeoVim)
|
||||
(parameter (tuple_pattern (tuple_item_pattern (value_identifier) @variable.parameter)))
|
||||
(parameter (array_pattern (value_identifier) @variable.parameter))
|
||||
(parameter (record_pattern (value_identifier) @variable.parameter))
|
||||
|
||||
; Meta
|
||||
;-----
|
||||
|
||||
[
|
||||
"@"
|
||||
"@@"
|
||||
(decorator_identifier)
|
||||
] @keyword.directive
|
||||
(decorator_identifier) @keyword.directive
|
||||
|
||||
(extension_identifier) @keyword
|
||||
("%") @keyword
|
||||
@ -87,7 +88,7 @@
|
||||
; Misc
|
||||
;-----
|
||||
|
||||
; (subscript_expression index: (string) @attribute)
|
||||
(subscript_expression index: (string) @attribute)
|
||||
(polyvar_type_pattern "#" @constant)
|
||||
|
||||
[
|
||||
@ -101,18 +102,21 @@
|
||||
"external"
|
||||
"let"
|
||||
"module"
|
||||
"mutable"
|
||||
"private"
|
||||
"rec"
|
||||
"type"
|
||||
"and"
|
||||
"assert"
|
||||
"async"
|
||||
"await"
|
||||
"with"
|
||||
"unpack"
|
||||
] @keyword.storage.type
|
||||
"lazy"
|
||||
"constraint"
|
||||
] @keyword
|
||||
|
||||
"mutable" @keyword.storage.modifier
|
||||
((function "async" @keyword.storage))
|
||||
|
||||
(module_unpack "unpack" @keyword)
|
||||
|
||||
[
|
||||
"if"
|
||||
@ -169,6 +173,7 @@
|
||||
"->"
|
||||
"|>"
|
||||
":>"
|
||||
"+="
|
||||
(uncurry)
|
||||
] @operator
|
||||
|
||||
|
@ -1,8 +1,29 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
((comment) @injection.content (#set! injection.language "comment"))
|
||||
|
||||
((raw_js) @injection.content
|
||||
(#set! injection.language "javascript"))
|
||||
; %re
|
||||
(extension_expression
|
||||
(extension_identifier) @_name
|
||||
(#eq? @_name "re")
|
||||
(expression_statement (_) @injection.content (#set! injection.language "regex")))
|
||||
|
||||
; %raw
|
||||
(extension_expression
|
||||
(extension_identifier) @_name
|
||||
(#eq? @_name "raw")
|
||||
(expression_statement
|
||||
(_ (_) @injection.content (#set! injection.language "javascript"))))
|
||||
|
||||
; %graphql
|
||||
(extension_expression
|
||||
(extension_identifier) @_name
|
||||
(#eq? @_name "graphql")
|
||||
(expression_statement
|
||||
(_ (_) @injection.content (#set! injection.language "graphql"))))
|
||||
|
||||
; %relay
|
||||
(extension_expression
|
||||
(extension_identifier) @_name
|
||||
(#eq? @_name "relay")
|
||||
(expression_statement
|
||||
(_ (_) @injection.content (#set! injection.language "graphql") )))
|
||||
|
||||
((raw_gql) @injection.content
|
||||
(#set! injection.language "graphql"))
|
@ -1,7 +1,7 @@
|
||||
(switch_expression) @local.scope
|
||||
(if_expression) @local.scope
|
||||
|
||||
; Definitions
|
||||
;------------
|
||||
(type_declaration) @local.defintion
|
||||
(let_binding) @local.defintion
|
||||
(type_declaration) @local.definition
|
||||
(let_binding) @local.definition
|
||||
(module_declaration) @local.definition
|
||||
|
@ -1,7 +1,7 @@
|
||||
; Classes (modules)
|
||||
;------------------
|
||||
|
||||
(module_declaration definition: ((_) @class.inside)) @class.around
|
||||
(module_binding definition: ((_) @class.inside)) @class.around
|
||||
|
||||
; Blocks
|
||||
;-------
|
||||
|
Loading…
Reference in New Issue
Block a user