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:
Amaan Qureshi 2023-05-06 11:12:49 -04:00 committed by GitHub
parent e8081bb162
commit 12453e0e3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1787 additions and 52 deletions

View file

@ -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

View file

@ -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)