mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(roc)!: bump parser and queries
Adapt to https://github.com/faldor20/tree-sitter-roc/pull/30 Also synchronize queries with upstream and add indents
This commit is contained in:
parent
f06adcf572
commit
afe977dadd
5 changed files with 107 additions and 11 deletions
|
|
@ -681,7 +681,7 @@
|
|||
"revision": "8e3a4205b76236bb6dbebdbee5afc262ce38bb62"
|
||||
},
|
||||
"roc": {
|
||||
"revision": "de0839d6c7db2405e827435cf3ac62d22f4bd5e9"
|
||||
"revision": "54c9a725fc7a419ccec8ad1a7761631f857b553a"
|
||||
},
|
||||
"ron": {
|
||||
"revision": "78938553b93075e638035f624973083451b29055"
|
||||
|
|
|
|||
|
|
@ -32,6 +32,12 @@
|
|||
(field_access_expr
|
||||
(identifier) @variable.member)
|
||||
|
||||
;highlight module members as records instead of free variables
|
||||
; avoids highlighting them as out-of-scope vars
|
||||
(variable_expr
|
||||
(module)
|
||||
(identifier) @variable.member)
|
||||
|
||||
;----comments----
|
||||
(line_comment) @comment @spell
|
||||
|
||||
|
|
@ -41,8 +47,8 @@
|
|||
[
|
||||
"?"
|
||||
(arrow)
|
||||
(back_arrow)
|
||||
(backslash)
|
||||
(fat_arrow)
|
||||
"|"
|
||||
","
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
|
@ -59,6 +65,8 @@
|
|||
[
|
||||
"|"
|
||||
"&"
|
||||
"<-"
|
||||
".."
|
||||
(operator)
|
||||
] @operator
|
||||
|
||||
|
|
@ -92,10 +100,6 @@
|
|||
"imports"
|
||||
] @keyword.import
|
||||
|
||||
(backpassing_expr
|
||||
assignee: (identifier_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
(value_declaration
|
||||
(decl_left
|
||||
(identifier_pattern
|
||||
|
|
@ -105,8 +109,7 @@
|
|||
|
||||
;----tags----
|
||||
(tags_type
|
||||
(apply_type
|
||||
(concrete_type) @constructor))
|
||||
(tag_type) @constructor)
|
||||
|
||||
[
|
||||
(tag)
|
||||
|
|
@ -123,11 +126,11 @@
|
|||
"dbg" @keyword.debug
|
||||
|
||||
;----function invocations ----
|
||||
(function_call_expr
|
||||
(function_call_pnc_expr
|
||||
caller: (variable_expr
|
||||
(identifier) @function.call))
|
||||
|
||||
(function_call_expr
|
||||
(function_call_pnc_expr
|
||||
caller: (field_access_expr
|
||||
(identifier) @function.call .))
|
||||
|
||||
|
|
|
|||
60
queries/roc/indents.scm
Normal file
60
queries/roc/indents.scm
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
; (value_declaration(expr_body(anon_fun_expr)))@indent.ignore
|
||||
[
|
||||
(when_is_expr)
|
||||
(when_is_branch)
|
||||
(record_expr)
|
||||
(anon_fun_expr)
|
||||
(list_expr)
|
||||
(parenthesized_expr)
|
||||
(function_call_pnc_expr)
|
||||
(tuple_expr)
|
||||
(imports)
|
||||
(exposes)
|
||||
(exposes_list)
|
||||
(exposing)
|
||||
;patterns
|
||||
(record_pattern)
|
||||
(tuple_pattern)
|
||||
(list_pattern)
|
||||
;ability stuff
|
||||
(ability_implementation)
|
||||
(opaque_type_def)
|
||||
;types
|
||||
(record_type)
|
||||
(tags_type)
|
||||
(record_expr)
|
||||
(implements_implementation)
|
||||
"{"
|
||||
"("
|
||||
"["
|
||||
] @indent.begin
|
||||
|
||||
; ((record_type)
|
||||
; @indent.align
|
||||
; (#set! indent.open_delimiter "{")
|
||||
; (#set! indent.close_delimiter "}"))
|
||||
; ((record_expr)
|
||||
; @indent.align
|
||||
; (#set! indent.open_delimiter "{")
|
||||
; (#set! indent.close_delimiter "}"))
|
||||
; ((tags_type) @indent.align
|
||||
; (#set! indent.open_delimiter "[")
|
||||
; (#set! indent.close_delimiter "]"))
|
||||
; ((implements_implementation) @indent.align
|
||||
; (#set! indent.open_delimiter "[")
|
||||
; (#set! indent.close_delimiter "]"))
|
||||
(expr_body) @indent.begin
|
||||
|
||||
(ERROR
|
||||
"=") @indent.begin
|
||||
|
||||
(then) @indent.begin
|
||||
|
||||
(else) @indent.begin
|
||||
|
||||
[
|
||||
; result:(_)
|
||||
"]"
|
||||
"}"
|
||||
")"
|
||||
] @indent.branch
|
||||
|
|
@ -1,3 +1,28 @@
|
|||
;injection from function calls
|
||||
(function_call_pnc_expr
|
||||
(variable_expr
|
||||
(identifier) @injection.language)
|
||||
(const
|
||||
[
|
||||
(multiline_string)
|
||||
(string)
|
||||
] @injection.content)
|
||||
(#any-eq? @injection.language
|
||||
"json" "toml" "yaml" "xml" "sql" "lua" "js" "html" "css" "http" "jq" "latex" "md" "nix" "regex"))
|
||||
|
||||
;injection from piping function calls
|
||||
(bin_op_expr
|
||||
part: (const
|
||||
[
|
||||
(multiline_string)
|
||||
(string)
|
||||
] @injection.content)
|
||||
part: (operator)
|
||||
part: (variable_expr
|
||||
(identifier) @injection.language)
|
||||
(#any-eq? @injection.language
|
||||
"json" "toml" "yaml" "xml" "sql" "lua" "js" "html" "css" "http" "jq" "latex" "md" "nix" "regex"))
|
||||
|
||||
([
|
||||
(line_comment)
|
||||
(doc_comment)
|
||||
|
|
|
|||
|
|
@ -35,6 +35,14 @@
|
|||
(identifier_pattern
|
||||
(identifier) @local.definition)
|
||||
|
||||
(when_is_branch
|
||||
pattern: (_
|
||||
(identifier_pattern
|
||||
(identifier) @local.definition)))
|
||||
|
||||
(spread_pattern
|
||||
(identifier) @local.definition)
|
||||
|
||||
(identifier) @local.reference
|
||||
|
||||
(tag_expr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue