nvim-treesitter/runtime/queries/groq/highlights.scm

103 lines
1.3 KiB
Scheme
Raw Normal View History

2025-07-17 21:10:37 +01:00
; Keywords
[
"select"
"asc"
"desc"
] @keyword
2025-07-17 21:10:37 +01:00
[
"in"
"match"
] @keyword.operator
2025-07-17 21:10:37 +01:00
; Operators
[
"=="
"!="
">"
">="
"<"
"<="
"&&"
"||"
"!"
"+"
"-"
"*"
"/"
"%"
"**"
".."
"..."
"=>"
"->"
"|"
] @operator
2025-07-17 21:10:37 +01:00
; Punctuation
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
[
","
":"
"."
] @punctuation.delimiter
2025-07-17 21:10:37 +01:00
; Literals
(string) @string
2025-07-17 21:10:37 +01:00
(number) @number
2025-07-17 21:10:37 +01:00
[
(true)
(false)
] @boolean
2025-07-17 21:10:37 +01:00
; Special references
[
(null)
(star)
(parent)
(this)
] @constant.builtin
2025-07-17 21:10:37 +01:00
; Identifiers
(identifier) @variable
2025-07-17 21:10:37 +01:00
; Parameters
(parameter) @variable.parameter
2025-07-17 21:10:37 +01:00
; Function calls
(function_call
(identifier) @function)
(order_function
"order" @function.builtin)
2025-07-17 21:10:37 +01:00
; Comments
2025-07-18 09:02:21 +01:00
(comment) @comment @spell
2025-07-17 21:10:37 +01:00
; String keys in projections/objects
(pair
2025-07-17 21:10:37 +01:00
(literal
(string) @property))
2025-07-17 21:10:37 +01:00
; Highlight field names in projections
(projection
(identifier) @property)
2025-07-17 21:10:37 +01:00
; Built-in functions (essential GROQ functions)
(function_call
(identifier) @function.builtin
2025-07-18 08:53:23 +01:00
(#any-of? @function.builtin
"count" "length" "defined" "references" "now" "dateTime" "coalesce" "unique" "max" "min" "sum"
"avg" "round" "floor" "ceil" "abs" "sqrt" "upper" "lower" "string" "number" "boolean" "array"
"object" "type" "global" "sanity" "path" "delta" "after" "before"))