diff options
| author | Alan Russell <ajrussellaudio@gmail.com> | 2025-07-18 17:04:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-18 18:04:42 +0200 |
| commit | 61ec748ef7624b1962f392191aad61b91c0f9829 (patch) | |
| tree | 84fb1dedbe96ca7b624058b8c1ab400c32a5be86 /runtime/queries/groq/highlights.scm | |
| parent | feat(parsers): update arduino, editorconfig, gdscript, idl, javadoc, koto, ma... (diff) | |
| download | nvim-treesitter-61ec748ef7624b1962f392191aad61b91c0f9829.tar nvim-treesitter-61ec748ef7624b1962f392191aad61b91c0f9829.tar.gz nvim-treesitter-61ec748ef7624b1962f392191aad61b91c0f9829.tar.bz2 nvim-treesitter-61ec748ef7624b1962f392191aad61b91c0f9829.tar.lz nvim-treesitter-61ec748ef7624b1962f392191aad61b91c0f9829.tar.xz nvim-treesitter-61ec748ef7624b1962f392191aad61b91c0f9829.tar.zst nvim-treesitter-61ec748ef7624b1962f392191aad61b91c0f9829.zip | |
feat(groq): add parser and queries (#8008)
Diffstat (limited to 'runtime/queries/groq/highlights.scm')
| -rw-r--r-- | runtime/queries/groq/highlights.scm | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/runtime/queries/groq/highlights.scm b/runtime/queries/groq/highlights.scm new file mode 100644 index 000000000..e320e42c3 --- /dev/null +++ b/runtime/queries/groq/highlights.scm @@ -0,0 +1,104 @@ +; Keywords +[ + "select" + "asc" + "desc" +] @keyword + +[ + "in" + "match" +] @keyword.operator + +; Operators +[ + "==" + "!=" + ">" + ">=" + "<" + "<=" + "&&" + "||" + "!" + "+" + "-" + "*" + "/" + "%" + "**" + ".." + "..." + "=>" + "->" + "|" +] @operator + +; Punctuation +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "," + ":" + "." +] @punctuation.delimiter + +; Literals +(string) @string + +(number) @number + +[ + (true) + (false) +] @boolean + +; Special references +[ + (null) + (star) + (parent) + (this) +] @constant.builtin + +; Identifiers +(identifier) @variable + +; Parameters +(parameter + "$" @variable.parameter + (identifier) @variable.parameter) + +; Function calls +(function_call + (identifier) @function) + +(order_function + "order" @function.builtin) + +; Comments +(comment) @comment @spell + +; String keys in projections/objects +(pair + (literal + (string) @property)) + +; Highlight field names in projections +(projection + (identifier) @property) + +; Built-in functions (essential GROQ functions) +(function_call + (identifier) @function.builtin + (#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")) |
