mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 18:00:07 -04:00
Update Capnp (#4713)
* feat(capnp): update queries from upstream changes * test: add tests for capnp * fix indent queries * ci: fix capnp indent tests --------- Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
This commit is contained in:
parent
e8081bb162
commit
12453e0e3d
5 changed files with 1787 additions and 52 deletions
|
|
@ -1,7 +1,9 @@
|
|||
; Preproc
|
||||
|
||||
(unique_id) @preproc
|
||||
(top_level_annotation_body) @preproc
|
||||
[
|
||||
(unique_id)
|
||||
(top_level_annotation_body)
|
||||
] @preproc
|
||||
|
||||
; Includes
|
||||
|
||||
|
|
@ -9,12 +11,30 @@
|
|||
"import"
|
||||
"$import"
|
||||
"embed"
|
||||
"using"
|
||||
] @include
|
||||
|
||||
(import_path) @string
|
||||
(import_path) @string @text.uri
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"annotation"
|
||||
"enum"
|
||||
"group"
|
||||
"interface"
|
||||
"struct"
|
||||
"union"
|
||||
"extends"
|
||||
"namespace"
|
||||
] @keyword
|
||||
|
||||
; Builtins
|
||||
|
||||
[
|
||||
"const"
|
||||
] @type.qualifier
|
||||
|
||||
[
|
||||
(primitive_type)
|
||||
"List"
|
||||
|
|
@ -30,8 +50,10 @@
|
|||
|
||||
; Methods
|
||||
|
||||
(annotation_definition_identifier) @method
|
||||
(method_identifier) @method
|
||||
[
|
||||
(annotation_definition_identifier)
|
||||
(method_identifier)
|
||||
] @method
|
||||
|
||||
; Fields
|
||||
|
||||
|
|
@ -43,53 +65,41 @@
|
|||
|
||||
; Parameters
|
||||
|
||||
(param_identifier) @parameter
|
||||
(return_identifier) @parameter
|
||||
[
|
||||
(param_identifier)
|
||||
(return_identifier)
|
||||
] @parameter
|
||||
|
||||
(annotation_target) @parameter.builtin
|
||||
|
||||
; Constants
|
||||
|
||||
(const_identifier) @constant
|
||||
(local_const) @constant
|
||||
(enum_member) @constant
|
||||
[
|
||||
(const_identifier)
|
||||
(local_const)
|
||||
(enum_member)
|
||||
] @constant
|
||||
|
||||
(void) @constant.builtin
|
||||
|
||||
; Types
|
||||
|
||||
(enum_identifier) @type
|
||||
(extend_type) @type
|
||||
(type_identifier) @type
|
||||
[
|
||||
(enum_identifier)
|
||||
(extend_type)
|
||||
(type_identifier)
|
||||
] @type
|
||||
|
||||
; Attributes
|
||||
|
||||
(annotation_identifier) @attribute
|
||||
(attribute) @attribute
|
||||
[
|
||||
(annotation_identifier)
|
||||
(attribute)
|
||||
] @attribute
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
; @ ! -
|
||||
"="
|
||||
] @operator
|
||||
|
||||
; Keywords
|
||||
|
||||
|
||||
[
|
||||
"annotation"
|
||||
"enum"
|
||||
"group"
|
||||
"interface"
|
||||
"struct"
|
||||
"union"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"extends"
|
||||
"namespace"
|
||||
"using"
|
||||
(annotation_target)
|
||||
] @keyword
|
||||
"=" @operator
|
||||
|
||||
; Literals
|
||||
|
||||
|
|
@ -100,6 +110,8 @@
|
|||
(namespace)
|
||||
] @string
|
||||
|
||||
(namespace) @text.underline
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(data_string) @string.special
|
||||
|
|
@ -110,11 +122,9 @@
|
|||
|
||||
(boolean) @boolean
|
||||
|
||||
; Misc
|
||||
(data_hex) @symbol
|
||||
|
||||
[
|
||||
"const"
|
||||
] @type.qualifier
|
||||
; Punctuation
|
||||
|
||||
[
|
||||
"*"
|
||||
|
|
@ -129,13 +139,16 @@
|
|||
["[" "]"] @punctuation.bracket
|
||||
|
||||
[
|
||||
"."
|
||||
","
|
||||
";"
|
||||
"->"
|
||||
] @punctuation.delimiter
|
||||
|
||||
(data_hex) @symbol
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
|
||||
; Errors
|
||||
|
||||
(ERROR) @error
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[
|
||||
(annotation_targets)
|
||||
(const_list)
|
||||
(const)
|
||||
(enum)
|
||||
(interface)
|
||||
(implicit_generics)
|
||||
|
|
@ -9,26 +9,28 @@
|
|||
(method_parameters)
|
||||
(named_return_types)
|
||||
(struct)
|
||||
(struct_shorthand)
|
||||
(union)
|
||||
(field)
|
||||
] @indent.begin
|
||||
|
||||
((struct_shorthand (property)) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
|
||||
((method (field_version)) @indent.align
|
||||
(#set! indent.open_delimiter field_version))
|
||||
|
||||
((const_list (const_value)) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
(#set! indent.open_delimiter "[")
|
||||
(#set! indent.close_delimiter "]"))
|
||||
|
||||
(concatenated_string) @indent.align
|
||||
|
||||
[
|
||||
"}"
|
||||
")"
|
||||
] @indent.end
|
||||
] @indent.end @indent.branch
|
||||
|
||||
[ "{" "}" ] @indent.branch
|
||||
|
||||
[ "(" ")" ] @indent.branch
|
||||
|
||||
[
|
||||
(ERROR)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue