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

@ -1,7 +1,6 @@
[
(function_call)
(code_block)
(function_block)
(control_structure)
(function_call)
(code_block)
(function_block)
(control_structure)
] @fold

View file

@ -1,20 +1,24 @@
; highlights.scm
; See this for full list: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md
; comments
(line_comment) @comment @spell
(block_comment) @comment @spell
; Argument definition
(argument name: (identifier) @variable.parameter)
(argument
name: (identifier) @variable.parameter)
; Variables
(local_var name: (identifier) @variable)
(environment_var name:(identifier) @variable.builtin)
(local_var
name: (identifier) @variable)
(environment_var
name: (identifier) @variable.builtin)
(builtin_var) @constant.builtin
; (variable) @variable
; Functions
(function_definition
name: (variable) @function)
@ -25,49 +29,51 @@
; Methods
(method_call
name: (method_name) @function.method)
name: (method_name) @function.method)
; Classes
(class) @type
; Literals
(number) @number
(float) @number.float
(string) @string
(symbol) @string.special.symbol
; Operators
[
"&&"
"||"
"&"
"|"
"^"
"=="
"!="
"<"
"<="
">"
">="
"<<"
">>"
"+"
"-"
"*"
"/"
"%"
"="
"&&"
"||"
"&"
"|"
"^"
"=="
"!="
"<"
"<="
">"
">="
"<<"
">>"
"+"
"-"
"*"
"/"
"%"
"="
] @operator
; Keywords
[
"arg"
"classvar"
"const"
; "super"
; "this"
"var"
"arg"
"classvar"
"const"
; "super"
; "this"
"var"
] @keyword
; Brackets

View file

@ -10,13 +10,15 @@
(const)
(instance_var)
(variable_definition)
(variable_definition_sequence (variable_definition))
(variable_definition_sequence
(variable_definition))
(control_structure)
(return_statement)
] @indent.begin
[
(parameter_call_list (argument_calls))
(parameter_call_list
(argument_calls))
"("
")"
"{"

View file

@ -1,5 +1,5 @@
([
(line_comment)
(block_comment)
] @injection.content
(#set! injection.language "comment"))
] @injection.content
(#set! injection.language "comment"))

View file

@ -1,27 +1,31 @@
; Scopes
[
(function_call)
(code_block)
(function_block)
(control_structure)
(function_call)
(code_block)
(function_block)
(control_structure)
] @local.scope
; Definitions
(argument
name: (identifier) @local.definition.parameter
(#set! "definition.var.scope" "local")
)
(argument
name: (identifier) @local.definition.parameter
(#set! "definition.var.scope" "local"))
(variable_definition
name: (variable (local_var (identifier) @local.definition.var
)))
(variable_definition
name:
(variable
(local_var
(identifier) @local.definition.var)))
(variable_definition
name: (variable (environment_var (identifier) @local.definition.var))
(#set! "definition.var.scope" "global"))
(variable_definition
name:
(variable
(environment_var
(identifier) @local.definition.var))
(#set! "definition.var.scope" "global"))
(function_definition name: (variable) @local.definition.var
(#set! "definition.var.scope" "parent")
)
(function_definition
name: (variable) @local.definition.var
(#set! "definition.var.scope" "parent"))
(identifier) @local.reference