mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
feat: add prql (#4393)
* feat: add prql * highlights(prql): null as constant.builtin * highlights(prql): add missing kwd, update queries * highlights(prql): remove redundant queries * highlights(prql): make `->` a delimiter * highlights(prql): instructions to `@method.call`
This commit is contained in:
parent
9dd1b9c097
commit
0572657d4d
5 changed files with 168 additions and 0 deletions
|
|
@ -286,6 +286,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||||
- [x] [Path of Exile item filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter) (experimental, maintained by @ObserverOfTime)
|
- [x] [Path of Exile item filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter) (experimental, maintained by @ObserverOfTime)
|
||||||
- [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva)
|
- [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva)
|
||||||
- [x] [proto](https://github.com/mitchellh/tree-sitter-proto) (maintained by @fsouza)
|
- [x] [proto](https://github.com/mitchellh/tree-sitter-proto) (maintained by @fsouza)
|
||||||
|
- [x] [prql](https://github.com/PRQL/tree-sitter-prql) (maintained by @matthias-Q)
|
||||||
- [x] [pug](https://github.com/zealot128/tree-sitter-pug) (experimental, maintained by @zealot128)
|
- [x] [pug](https://github.com/zealot128/tree-sitter-pug) (experimental, maintained by @zealot128)
|
||||||
- [x] [python](https://github.com/tree-sitter/tree-sitter-python) (maintained by @stsewd, @theHamsta)
|
- [x] [python](https://github.com/tree-sitter/tree-sitter-python) (maintained by @stsewd, @theHamsta)
|
||||||
- [x] [ql](https://github.com/tree-sitter/tree-sitter-ql) (maintained by @pwntester)
|
- [x] [ql](https://github.com/tree-sitter/tree-sitter-ql) (maintained by @pwntester)
|
||||||
|
|
|
||||||
|
|
@ -338,6 +338,9 @@
|
||||||
"proto": {
|
"proto": {
|
||||||
"revision": "42d82fa18f8afe59b5fc0b16c207ee4f84cb185f"
|
"revision": "42d82fa18f8afe59b5fc0b16c207ee4f84cb185f"
|
||||||
},
|
},
|
||||||
|
"prql": {
|
||||||
|
"revision": "3f27cac466f030ee7d985d91eba5470e01dd21ea"
|
||||||
|
},
|
||||||
"pug": {
|
"pug": {
|
||||||
"revision": "884e225b5ecca5d885ae627275f16ef648acd42e"
|
"revision": "884e225b5ecca5d885ae627275f16ef648acd42e"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1086,6 +1086,16 @@ list.proto = {
|
||||||
filetype = "proto",
|
filetype = "proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.prql = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/PRQL/tree-sitter-prql",
|
||||||
|
branch = "main",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@matthias-Q" },
|
||||||
|
filetype = "prql",
|
||||||
|
}
|
||||||
|
|
||||||
list.pug = {
|
list.pug = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/zealot128/tree-sitter-pug",
|
url = "https://github.com/zealot128/tree-sitter-pug",
|
||||||
|
|
|
||||||
141
queries/prql/highlights.scm
Normal file
141
queries/prql/highlights.scm
Normal file
|
|
@ -0,0 +1,141 @@
|
||||||
|
[
|
||||||
|
(keyword_from)
|
||||||
|
(keyword_filter)
|
||||||
|
(keyword_derive)
|
||||||
|
(keyword_group)
|
||||||
|
(keyword_aggregate)
|
||||||
|
(keyword_sort)
|
||||||
|
(keyword_take)
|
||||||
|
(keyword_window)
|
||||||
|
(keyword_join)
|
||||||
|
(keyword_select)
|
||||||
|
(keyword_switch)
|
||||||
|
(keyword_append)
|
||||||
|
(keyword_remove)
|
||||||
|
(keyword_intersect)
|
||||||
|
(keyword_rolling)
|
||||||
|
(keyword_rows)
|
||||||
|
(keyword_expanding)
|
||||||
|
(keyword_let)
|
||||||
|
(keyword_prql)
|
||||||
|
(keyword_from_text)
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
(literal)
|
||||||
|
(f_string)
|
||||||
|
(s_string)
|
||||||
|
] @string
|
||||||
|
|
||||||
|
(assignment
|
||||||
|
alias: (field) @field)
|
||||||
|
|
||||||
|
alias: (identifier) @field
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
(keyword_func) @keyword.function
|
||||||
|
|
||||||
|
(function_call
|
||||||
|
(identifier) @function.call)
|
||||||
|
|
||||||
|
[
|
||||||
|
"+"
|
||||||
|
"-"
|
||||||
|
"*"
|
||||||
|
"/"
|
||||||
|
"="
|
||||||
|
"=="
|
||||||
|
"<"
|
||||||
|
"<="
|
||||||
|
"!="
|
||||||
|
">="
|
||||||
|
">"
|
||||||
|
(bang)
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
","
|
||||||
|
"."
|
||||||
|
(pipe)
|
||||||
|
"->"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
(integer) @number
|
||||||
|
|
||||||
|
(decimal_number) @float
|
||||||
|
|
||||||
|
[
|
||||||
|
(keyword_min)
|
||||||
|
(keyword_max)
|
||||||
|
(keyword_count)
|
||||||
|
(keyword_count_distinct)
|
||||||
|
(keyword_average)
|
||||||
|
(keyword_avg)
|
||||||
|
(keyword_sum)
|
||||||
|
(keyword_stddev)
|
||||||
|
(keyword_count)
|
||||||
|
] @function
|
||||||
|
|
||||||
|
[
|
||||||
|
(keyword_side)
|
||||||
|
(keyword_format)
|
||||||
|
] @attribute
|
||||||
|
|
||||||
|
[
|
||||||
|
(keyword_version)
|
||||||
|
(keyword_target)
|
||||||
|
] @type.qualifier
|
||||||
|
|
||||||
|
(target) @function.builtin
|
||||||
|
|
||||||
|
[
|
||||||
|
(date)
|
||||||
|
(time)
|
||||||
|
(timestamp)
|
||||||
|
] @string.special
|
||||||
|
|
||||||
|
[
|
||||||
|
(keyword_left)
|
||||||
|
(keyword_inner)
|
||||||
|
(keyword_right)
|
||||||
|
(keyword_full)
|
||||||
|
(keyword_csv)
|
||||||
|
(keyword_json)
|
||||||
|
] @method.call
|
||||||
|
|
||||||
|
[
|
||||||
|
(keyword_true)
|
||||||
|
(keyword_false)
|
||||||
|
] @boolean
|
||||||
|
|
||||||
|
[
|
||||||
|
(keyword_and)
|
||||||
|
(keyword_or)
|
||||||
|
(keyword_in)
|
||||||
|
] @keyword.operator
|
||||||
|
|
||||||
|
(function_definition
|
||||||
|
(keyword_func)
|
||||||
|
name: (identifier) @function)
|
||||||
|
|
||||||
|
(parameter
|
||||||
|
(identifier) @parameter)
|
||||||
|
|
||||||
|
(variable
|
||||||
|
(keyword_let)
|
||||||
|
name: (identifier) @constant)
|
||||||
|
|
||||||
|
|
||||||
|
(keyword_null) @constant.builtin
|
||||||
|
|
||||||
|
|
||||||
13
queries/prql/injections.scm
Normal file
13
queries/prql/injections.scm
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
(
|
||||||
|
(s_string) @sql
|
||||||
|
(#offset! @sql 0 2 0 -1)
|
||||||
|
)
|
||||||
|
|
||||||
|
(from_text
|
||||||
|
(keyword_from_text)
|
||||||
|
(keyword_json)
|
||||||
|
(literal) @json
|
||||||
|
(#offset! @json 0 3 0 -3)
|
||||||
|
)
|
||||||
|
|
||||||
|
(comment) @comment
|
||||||
Loading…
Add table
Add a link
Reference in a new issue