mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 18:30:06 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,8 +1,12 @@
|
|||
((atom) @constant (#set! "priority" "90"))
|
||||
((atom) @constant
|
||||
(#set! "priority" "90"))
|
||||
|
||||
(var) @variable
|
||||
|
||||
(char) @character
|
||||
|
||||
(integer) @number
|
||||
|
||||
(float) @number.float
|
||||
|
||||
(comment) @comment @spell
|
||||
|
|
@ -10,13 +14,13 @@
|
|||
((comment) @comment.documentation
|
||||
(#lua-match? @comment.documentation "^[%%][%%]"))
|
||||
|
||||
;; keyword
|
||||
; keyword
|
||||
[
|
||||
"fun"
|
||||
"div"
|
||||
] @keyword
|
||||
|
||||
;; bracket
|
||||
; bracket
|
||||
[
|
||||
"("
|
||||
")"
|
||||
|
|
@ -27,7 +31,7 @@
|
|||
"#"
|
||||
] @punctuation.bracket
|
||||
|
||||
;;; Comparisons
|
||||
; Comparisons
|
||||
[
|
||||
"=="
|
||||
"=:="
|
||||
|
|
@ -36,14 +40,14 @@
|
|||
">="
|
||||
"<"
|
||||
">"
|
||||
] @operator ;; .comparison
|
||||
] @operator ; .comparison
|
||||
|
||||
;;; operator
|
||||
; operator
|
||||
[
|
||||
":"
|
||||
":="
|
||||
"!"
|
||||
;; "-"
|
||||
; "-"
|
||||
"+"
|
||||
"="
|
||||
"->"
|
||||
|
|
@ -58,7 +62,7 @@
|
|||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
;; conditional
|
||||
; conditional
|
||||
[
|
||||
"receive"
|
||||
"if"
|
||||
|
|
@ -77,54 +81,108 @@
|
|||
"try"
|
||||
] @keyword.exception
|
||||
|
||||
((atom) @boolean (#any-of? @boolean "true" "false"))
|
||||
((atom) @boolean
|
||||
(#any-of? @boolean "true" "false"))
|
||||
|
||||
;; Macros
|
||||
((macro_call_expr) @constant.macro (#set! "priority" 101))
|
||||
; Macros
|
||||
((macro_call_expr) @constant.macro
|
||||
(#set! "priority" 101))
|
||||
|
||||
;; Preprocessor
|
||||
; Preprocessor
|
||||
(pp_define
|
||||
lhs: _ @constant.macro (#set! "priority" 101)
|
||||
)
|
||||
(_preprocessor_directive) @keyword.directive (#set! "priority" 99)
|
||||
lhs: _ @constant.macro
|
||||
(#set! "priority" 101))
|
||||
|
||||
;; Attributes
|
||||
(_preprocessor_directive) @keyword.directive
|
||||
(#set! "priority" 99)
|
||||
|
||||
; Attributes
|
||||
(pp_include) @keyword.import
|
||||
|
||||
(pp_include_lib) @keyword.import
|
||||
|
||||
(export_attribute) @keyword.import
|
||||
|
||||
(export_type_attribute) @type.definition
|
||||
(export_type_attribute types: (fa fun: _ @type (#set! "priority" 101)))
|
||||
|
||||
(export_type_attribute
|
||||
types:
|
||||
(fa
|
||||
fun: _ @type
|
||||
(#set! "priority" 101)))
|
||||
|
||||
(behaviour_attribute) @keyword.import
|
||||
(module_attribute (atom) @module) @keyword.import
|
||||
(wild_attribute name: (attr_name name: _ @attribute)) @attribute
|
||||
|
||||
;; Records
|
||||
(module_attribute
|
||||
(atom) @module) @keyword.import
|
||||
|
||||
(wild_attribute
|
||||
name:
|
||||
(attr_name
|
||||
name: _ @attribute)) @attribute
|
||||
|
||||
; Records
|
||||
(record_expr) @type
|
||||
(record_field_expr _ @variable.member) @type
|
||||
(record_field_name _ @variable.member) @type
|
||||
(record_name "#" @type name: _ @type) @type
|
||||
(record_decl name: _ @type) @type.definition
|
||||
(record_field name: _ @variable.member)
|
||||
(record_field name: _ @variable.member ty: _ @type)
|
||||
|
||||
;; Type alias
|
||||
(type_alias name: _ @type) @type.definition
|
||||
(record_field_expr
|
||||
_ @variable.member) @type
|
||||
|
||||
(record_field_name
|
||||
_ @variable.member) @type
|
||||
|
||||
(record_name
|
||||
"#" @type
|
||||
name: _ @type) @type
|
||||
|
||||
(record_decl
|
||||
name: _ @type) @type.definition
|
||||
|
||||
(record_field
|
||||
name: _ @variable.member)
|
||||
|
||||
(record_field
|
||||
name: _ @variable.member
|
||||
ty: _ @type)
|
||||
|
||||
; Type alias
|
||||
(type_alias
|
||||
name: _ @type) @type.definition
|
||||
|
||||
(spec) @type.definition
|
||||
|
||||
[(string) (binary)] @string
|
||||
[
|
||||
(string)
|
||||
(binary)
|
||||
] @string
|
||||
|
||||
;;; expr_function_call
|
||||
(call expr: [(atom) (remote) (var)] @function)
|
||||
(call (atom) @keyword.exception (#any-of? @keyword.exception "error" "throw" "exit"))
|
||||
|
||||
;;; Parenthesized expression: (SomeFunc)(), only highlight the parens
|
||||
; expr_function_call
|
||||
(call
|
||||
expr: (paren_expr "(" @function.call ")" @function.call)
|
||||
)
|
||||
expr:
|
||||
[
|
||||
(atom)
|
||||
(remote)
|
||||
(var)
|
||||
] @function)
|
||||
|
||||
;;; function
|
||||
(call
|
||||
(atom) @keyword.exception
|
||||
(#any-of? @keyword.exception "error" "throw" "exit"))
|
||||
|
||||
; Parenthesized expression: (SomeFunc)(), only highlight the parens
|
||||
(call
|
||||
expr:
|
||||
(paren_expr
|
||||
"(" @function.call
|
||||
")" @function.call))
|
||||
|
||||
; function
|
||||
(external_fun) @function.call
|
||||
(internal_fun fun: (atom) @function.call)
|
||||
(function_clause name: (atom) @function)
|
||||
(fa fun: (atom) @function)
|
||||
|
||||
(internal_fun
|
||||
fun: (atom) @function.call)
|
||||
|
||||
(function_clause
|
||||
name: (atom) @function)
|
||||
|
||||
(fa
|
||||
fun: (atom) @function)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue