mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,49 +1,41 @@
|
|||
; Includes
|
||||
|
||||
[
|
||||
"package"
|
||||
"import"
|
||||
] @keyword.import
|
||||
|
||||
; Namespaces
|
||||
|
||||
(package_identifier) @module
|
||||
|
||||
(import_spec ["." "_"] @punctuation.special)
|
||||
(import_spec
|
||||
[
|
||||
"."
|
||||
"_"
|
||||
] @punctuation.special)
|
||||
|
||||
[
|
||||
(attr_path)
|
||||
(package_path)
|
||||
] @string.special.url ;; In attributes
|
||||
] @string.special.url ; In attributes
|
||||
|
||||
; Attributes
|
||||
|
||||
(attribute) @attribute
|
||||
|
||||
; Conditionals
|
||||
|
||||
"if" @keyword.conditional
|
||||
|
||||
; Repeats
|
||||
"for" @keyword.repeat
|
||||
|
||||
[
|
||||
"for"
|
||||
] @keyword.repeat
|
||||
|
||||
(for_clause "_" @punctuation.special)
|
||||
(for_clause
|
||||
"_" @punctuation.special)
|
||||
|
||||
; Keywords
|
||||
"let" @keyword
|
||||
|
||||
[
|
||||
"let"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"in"
|
||||
] @keyword.operator
|
||||
"in" @keyword.operator
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
|
|
@ -66,34 +58,33 @@
|
|||
] @operator
|
||||
|
||||
; Fields & Properties
|
||||
|
||||
(field
|
||||
(label
|
||||
(identifier) @variable.member))
|
||||
(field
|
||||
(label
|
||||
(identifier) @variable.member))
|
||||
|
||||
(selector_expression
|
||||
(_)
|
||||
(identifier) @property)
|
||||
|
||||
; Functions
|
||||
|
||||
(call_expression
|
||||
function: (identifier) @function.call)
|
||||
|
||||
(call_expression
|
||||
function: (selector_expression
|
||||
(_)
|
||||
(identifier) @function.call))
|
||||
function:
|
||||
(selector_expression
|
||||
(_)
|
||||
(identifier) @function.call))
|
||||
|
||||
(call_expression
|
||||
function: (builtin_function) @function.call)
|
||||
|
||||
(builtin_function) @function.builtin
|
||||
|
||||
; Variables
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; Types
|
||||
|
||||
(primitive_type) @type.builtin
|
||||
|
||||
((identifier) @type
|
||||
|
|
@ -102,22 +93,33 @@
|
|||
[
|
||||
(slice_type)
|
||||
(pointer_type)
|
||||
] @type ;; In attributes
|
||||
] @type ; In attributes
|
||||
|
||||
; Punctuation
|
||||
|
||||
[
|
||||
","
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[ "{" "}" ] @punctuation.bracket
|
||||
[
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[ "[" "]" ] @punctuation.bracket
|
||||
[
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
[ "(" ")" ] @punctuation.bracket
|
||||
[
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
[ "<" ">" ] @punctuation.bracket
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
(ellipsis)
|
||||
|
|
@ -125,7 +127,6 @@
|
|||
] @punctuation.special
|
||||
|
||||
; Literals
|
||||
|
||||
(string) @string
|
||||
|
||||
[
|
||||
|
|
@ -150,11 +151,15 @@
|
|||
] @constant.builtin
|
||||
|
||||
; Interpolations
|
||||
(interpolation
|
||||
"\\(" @punctuation.special
|
||||
(_)
|
||||
")" @punctuation.special) @none
|
||||
|
||||
(interpolation "\\(" @punctuation.special (_) ")" @punctuation.special) @none
|
||||
|
||||
(interpolation "\\(" (identifier) @variable ")")
|
||||
(interpolation
|
||||
"\\("
|
||||
(identifier) @variable
|
||||
")")
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
|
|
|
|||
|
|
@ -9,11 +9,20 @@
|
|||
")"
|
||||
] @indent.end
|
||||
|
||||
[ "{" "}" ] @indent.branch
|
||||
[
|
||||
"{"
|
||||
"}"
|
||||
] @indent.branch
|
||||
|
||||
[ "[" "]" ] @indent.branch
|
||||
[
|
||||
"["
|
||||
"]"
|
||||
] @indent.branch
|
||||
|
||||
[ "(" ")" ] @indent.branch
|
||||
[
|
||||
"("
|
||||
")"
|
||||
] @indent.branch
|
||||
|
||||
[
|
||||
(ERROR)
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
; Scopes
|
||||
|
||||
[
|
||||
(source_file)
|
||||
(field)
|
||||
|
|
@ -7,17 +6,15 @@
|
|||
] @local.scope
|
||||
|
||||
; References
|
||||
|
||||
(identifier) @local.reference
|
||||
|
||||
; Definitions
|
||||
|
||||
(import_spec
|
||||
path: (string) @local.definition.import)
|
||||
|
||||
(field
|
||||
(label
|
||||
(identifier) @local.definition.field))
|
||||
(identifier) @local.definition.field))
|
||||
|
||||
(package_identifier) @local.definition.namespace
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue