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 +1,11 @@
[(list) (table) (sequential_table) (let) (fn) (let_clause) (quoted_list) (local) (global)] @fold
[
(list)
(table)
(sequential_table)
(let)
(fn)
(let_clause)
(quoted_list)
(local)
(global)
] @fold

View file

@ -18,29 +18,38 @@
] @punctuation.special
(nil) @constant.builtin
(vararg) @punctuation.special
(boolean) @boolean
(number) @number
(string) @string
(escape_sequence) @string.escape
(symbol) @variable
(multi_symbol
"." @punctuation.delimiter
(symbol) @variable.member)
"." @punctuation.delimiter
(symbol) @variable.member)
(multi_symbol_method
":" @punctuation.delimiter
(symbol) @function.method.call .)
":" @punctuation.delimiter
(symbol) @function.method.call .)
(list . (symbol) @function.call)
(list . (multi_symbol (symbol) @function.call .))
(list
.
(symbol) @function.call)
(list
.
(multi_symbol
(symbol) @function.call .))
((symbol) @variable.builtin
(#lua-match? @variable.builtin "^[$]"))
(#lua-match? @variable.builtin "^[$]"))
(binding) @string.special.symbol
@ -51,30 +60,34 @@
"#"
] @keyword.function
(fn name: [
(symbol) @function
(multi_symbol (symbol) @function .)
])
(fn
name:
[
(symbol) @function
(multi_symbol
(symbol) @function .)
])
(lambda name: [
(symbol) @function
(multi_symbol (symbol) @function .)
])
(lambda
name:
[
(symbol) @function
(multi_symbol
(symbol) @function .)
])
[
"for"
"each"
] @keyword.repeat
((symbol) @keyword.repeat
(#any-of? @keyword.repeat
"while"))
[
"match"
] @keyword.conditional
((symbol) @keyword.repeat
(#any-of? @keyword.repeat "while"))
"match" @keyword.conditional
((symbol) @keyword.conditional
(#any-of? @keyword.conditional
"if" "when"))
(#any-of? @keyword.conditional "if" "when"))
[
"global"
@ -85,13 +98,12 @@
"where"
"or"
] @keyword
((symbol) @keyword
(#any-of? @keyword
"comment" "do" "doc" "eval-compiler" "lua" "macros" "quote" "tset" "values"))
(#any-of? @keyword "comment" "do" "doc" "eval-compiler" "lua" "macros" "quote" "tset" "values"))
((symbol) @keyword.import
(#any-of? @keyword.import
"require" "require-macros" "import-macros" "include"))
(#any-of? @keyword.import "require" "require-macros" "import-macros" "include"))
[
"collect"
@ -100,22 +112,14 @@
] @function.macro
((symbol) @function.macro
(#any-of? @function.macro
"->" "->>" "-?>" "-?>>" "?." "doto" "macro" "macrodebug" "partial" "pick-args"
"pick-values" "with-open"))
(#any-of? @function.macro "->" "->>" "-?>" "-?>>" "?." "doto" "macro" "macrodebug" "partial" "pick-args" "pick-values" "with-open"))
; Lua builtins
((symbol) @constant.builtin
(#any-of? @constant.builtin
"arg" "_ENV" "_G" "_VERSION"))
(#any-of? @constant.builtin "arg" "_ENV" "_G" "_VERSION"))
((symbol) @function.builtin
(#any-of? @function.builtin
"assert" "collectgarbage" "dofile" "error" "getmetatable" "ipairs"
"load" "loadfile" "next" "pairs" "pcall" "print" "rawequal" "rawget"
"rawlen" "rawset" "require" "select" "setmetatable" "tonumber" "tostring"
"type" "warn" "xpcall"))
(#any-of? @function.builtin "assert" "collectgarbage" "dofile" "error" "getmetatable" "ipairs" "load" "loadfile" "next" "pairs" "pcall" "print" "rawequal" "rawget" "rawlen" "rawset" "require" "select" "setmetatable" "tonumber" "tostring" "type" "warn" "xpcall"))
((symbol) @function.builtin
(#any-of? @function.builtin
"loadstring" "module" "setfenv" "unpack"))
(#any-of? @function.builtin "loadstring" "module" "setfenv" "unpack"))

View file

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

View file

@ -1,26 +1,32 @@
[
(program)
(fn)
(lambda)
(let)
(each)
(for)
(match)
(program)
(fn)
(lambda)
(let)
(each)
(for)
(match)
] @local.scope
(
(list . (symbol) @_special) @local.scope
(#any-of? @_special
"while" "if" "when" "do" "collect" "icollect" "accumulate")
)
((list
.
(symbol) @_special) @local.scope
(#any-of? @_special "while" "if" "when" "do" "collect" "icollect" "accumulate"))
(fn name: (symbol) @local.definition.function
(fn
name: (symbol) @local.definition.function
(#set! definition.function.scope "parent"))
(lambda name: (symbol) @local.definition.function
(lambda
name: (symbol) @local.definition.function
(#set! definition.function.scope "parent"))
; TODO: use @local.definition.parameter for parameters
(binding (symbol) @local.definition.var)
(for_clause . (symbol) @local.definition.var)
(binding
(symbol) @local.definition.var)
(for_clause
.
(symbol) @local.definition.var)
(symbol) @local.reference