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,10 +1,10 @@
[
(field)
(object)
(array)
(parenthesis)
(bind)
; (params)
; (args)
; (conditional)
(field)
(object)
(array)
(parenthesis)
(bind)
; (params)
; (args)
; (conditional)
] @fold

View file

@ -1,10 +1,14 @@
(id) @variable
(comment) @comment @spell
; Literals
(null) @constant.builtin
(string) @string
(number) @number
[
(true)
(false)
@ -12,7 +16,9 @@
; Keywords
"for" @keyword.repeat
"in" @keyword.operator
"function" @keyword.function
[
@ -37,8 +43,9 @@
(self)
(super)
] @variable.builtin
((id) @variable.builtin
(#eq? @variable.builtin "std"))
(#eq? @variable.builtin "std"))
; Operators
[
@ -78,7 +85,8 @@
] @punctuation.special
(field
(fieldname) "+" @punctuation.special)
(fieldname)
"+" @punctuation.special)
; Imports
[
@ -87,21 +95,33 @@
] @keyword.import
; Fields
(fieldname
(id) @variable.member)
(fieldname (id) @variable.member)
(fieldname (string (string_content) @variable.member))
(fieldname
(string
(string_content) @variable.member))
; Functions
(field
function: (fieldname (id) @function))
function:
(fieldname
(id) @function))
(field
function: (fieldname
(string (string_content) @function)))
function:
(fieldname
(string
(string_content) @function)))
(param
identifier: (id) @variable.parameter)
(bind (id) @variable.local)
(bind function: (id) @function)
(bind
(id) @variable.local)
(bind
function: (id) @function)
; Function call
(functioncall
@ -113,6 +133,5 @@
"("
(args
(named_argument
(id) @variable.parameter
))?
(id) @variable.parameter))?
")")

View file

@ -1,17 +1,28 @@
(parenthesis) @local.scope
(anonymous_function) @local.scope
(object) @local.scope
(field) @local.scope
(local_bind) @local.scope
(field
function: (fieldname (id) @local.definition.function)
function:
(fieldname
(id) @local.definition.function)
(#set! "definition.function.scope" "parent"))
(bind (id) @local.definition.var)
(bind function: (id) @local.definition.function)
(bind
(id) @local.definition.var)
(param (id) @local.definition.parameter)
(bind
function: (id) @local.definition.function)
(param
(id) @local.definition.parameter)
(id) @local.reference
;(fieldname (id) (#is-not? local)) ; (#is-not?) not supported yet