chore: query formatting

This commit is contained in:
Pham Huy Hoang 2024-01-06 15:05:50 +09:00 committed by Christian Clason
parent 79975d6557
commit 57a8acf0c4
674 changed files with 18466 additions and 12648 deletions

View file

@ -7,6 +7,5 @@
(service_definition)
(struct_definition)
(union_definition)
(comment)
] @fold

View file

@ -1,51 +1,54 @@
; Variables
((identifier) @variable
(#set! "priority" 95))
; Includes
[
"include"
"cpp_include"
] @keyword.import
; Function
(function_definition
(identifier) @function)
; Fields
(field (identifier) @variable.member)
(field
(identifier) @variable.member)
; Parameters
(function_definition
(parameters
(parameter (identifier) @variable.parameter)))
(parameter
(identifier) @variable.parameter)))
(throws
(parameters
(parameter (identifier) @variable.parameter)))
(parameter
(identifier) @variable.parameter)))
; Types
(typedef_identifier) @type
(struct_definition
"struct" (identifier) @type)
"struct"
(identifier) @type)
(union_definition
"union" (identifier) @type)
"union"
(identifier) @type)
(exception_definition
"exception" (identifier) @type)
"exception"
(identifier) @type)
(service_definition
"service" (identifier) @type)
"service"
(identifier) @type)
(interaction_definition
"interaction" (identifier) @type)
"interaction"
(identifier) @type)
(type
type: (identifier) @type)
@ -57,16 +60,21 @@
(#lua-match? @type "^[_]*[A-Z]"))
; Constants
(const_definition
(identifier) @constant)
(const_definition (identifier) @constant)
((identifier) @constant
(#lua-match? @constant "^[_A-Z][A-Z0-9_]*$"))
(enum_definition "enum"
. (identifier) @type
"{" (identifier) @constant "}")
(enum_definition
"enum"
.
(identifier) @type
"{"
(identifier) @constant
"}")
; Builtin Types
(primitive) @type.builtin
[
@ -79,35 +87,38 @@
] @type.builtin
; Namespace
(namespace_declaration
(namespace_scope) @tag
[(namespace) @module (_ (identifier) @module)])
[
(namespace) @module
(_
(identifier) @module)
])
; Attributes
(annotation_definition
(annotation_identifier (identifier) @attribute))
(annotation_identifier
(identifier) @attribute))
(fb_annotation_definition
"@" @attribute (annotation_identifier (identifier) @attribute)
"@" @attribute
(annotation_identifier
(identifier) @attribute)
(identifier)? @attribute)
(namespace_uri (string) @attribute)
(namespace_uri
(string) @attribute)
; Operators
[
"="
"&"
] @operator
; Exceptions
[
"throws"
] @keyword.exception
"throws" @keyword.exception
; Keywords
[
"enum"
"exception"
@ -123,7 +134,6 @@
] @keyword
; Deprecated Keywords
[
"cocoa_prefix"
"cpp_namespace"
@ -155,7 +165,6 @@
] @keyword.coroutine
; Qualifiers
[
"client"
"const"
@ -171,7 +180,6 @@
] @type.qualifier
; Literals
(string) @string
(escape_sequence) @string.escape
@ -186,22 +194,30 @@
(boolean) @boolean
; Typedefs
(typedef_identifier) @type.definition
; Punctuation
"*" @punctuation.special
[
"*"
] @punctuation.special
"{"
"}"
] @punctuation.bracket
["{" "}"] @punctuation.bracket
[
"("
")"
] @punctuation.bracket
["(" ")"] @punctuation.bracket
[
"["
"]"
] @punctuation.bracket
["[" "]"] @punctuation.bracket
["<" ">"] @punctuation.bracket
[
"<"
">"
] @punctuation.bracket
[
"."
@ -211,7 +227,6 @@
] @punctuation.delimiter
; Comments
(comment) @comment @spell
((comment) @comment.documentation
@ -219,6 +234,7 @@
((comment) @comment.documentation
(#lua-match? @comment.documentation "^///[^/]"))
((comment) @comment.documentation
(#lua-match? @comment.documentation "^///$"))

View file

@ -1,14 +1,21 @@
(definition) @indent.begin
((parameters (parameter)) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")"))
((parameters
(parameter)) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")"))
"}" @indent.end
[ "{" "}" ] @indent.branch
[
"{"
"}"
] @indent.branch
[ "(" ")" ] @indent.branch
[
"("
")"
] @indent.branch
[
(ERROR)

View file

@ -1,2 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
(#set! injection.language "comment"))

View file

@ -1,51 +1,70 @@
; Scopes
[
(document)
(definition)
] @local.scope
; References
(identifier) @local.reference
; Definitions
(annotation_identifier) @local.definition
(const_definition (identifier) @local.definition.constant)
(const_definition
(identifier) @local.definition.constant)
(enum_definition "enum"
. (identifier) @local.definition.enum
"{" (identifier) @local.definition.constant "}")
(enum_definition
"enum"
.
(identifier) @local.definition.enum
"{"
(identifier) @local.definition.constant
"}")
(senum_definition "senum"
. (identifier) @local.definition.enum)
(senum_definition
"senum"
.
(identifier) @local.definition.enum)
(field (identifier) @local.definition.field)
(field
(identifier) @local.definition.field)
(function_definition (identifier) @local.definition.function)
(function_definition
(identifier) @local.definition.function)
(namespace_declaration
"namespace" (namespace_scope)
. (_) @local.definition.namespace
"namespace"
(namespace_scope)
.
(_) @local.definition.namespace
(namespace_uri)?)
(parameter (identifier) @local.definition.parameter)
(parameter
(identifier) @local.definition.parameter)
(struct_definition
"struct" . (identifier) @local.definition.type)
"struct"
.
(identifier) @local.definition.type)
(union_definition
"union" . (identifier) @local.definition.type)
"union"
.
(identifier) @local.definition.type)
(exception_definition
"exception" . (identifier) @local.definition.type)
"exception"
.
(identifier) @local.definition.type)
(service_definition
"service" . (identifier) @local.definition.type)
"service"
.
(identifier) @local.definition.type)
(interaction_definition
"interaction" . (identifier) @local.definition.type)
"interaction"
.
(identifier) @local.definition.type)
(typedef_identifier) @local.definition.type