mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
feat: add properties parser
This commit is contained in:
parent
670e7aa843
commit
6b24db0c8f
6 changed files with 46 additions and 0 deletions
|
|
@ -328,6 +328,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||||
- [x] [pony](https://github.com/amaanq/tree-sitter-pony) (maintained by @amaanq, @mfelsche)
|
- [x] [pony](https://github.com/amaanq/tree-sitter-pony) (maintained by @amaanq, @mfelsche)
|
||||||
- [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] [promql](https://github.com/MichaHoffmann/tree-sitter-promql) (maintained by @MichaHoffmann)
|
- [x] [promql](https://github.com/MichaHoffmann/tree-sitter-promql) (maintained by @MichaHoffmann)
|
||||||
|
- [x] [properties](https://github.com/ObserverOfTime/tree-sitter-properties) (maintained by @ObserverOfTime)
|
||||||
- [x] [proto](https://github.com/treywood/tree-sitter-proto) (maintained by @treywood)
|
- [x] [proto](https://github.com/treywood/tree-sitter-proto) (maintained by @treywood)
|
||||||
- [x] [prql](https://github.com/PRQL/tree-sitter-prql) (maintained by @matthias-Q)
|
- [x] [prql](https://github.com/PRQL/tree-sitter-prql) (maintained by @matthias-Q)
|
||||||
- [x] [psv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq)
|
- [x] [psv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq)
|
||||||
|
|
|
||||||
|
|
@ -464,6 +464,9 @@
|
||||||
"promql": {
|
"promql": {
|
||||||
"revision": "77625d78eebc3ffc44d114a07b2f348dff3061b0"
|
"revision": "77625d78eebc3ffc44d114a07b2f348dff3061b0"
|
||||||
},
|
},
|
||||||
|
"properties": {
|
||||||
|
"revision": "97253273bdf8b63546c8006e71ba155ecc27069e"
|
||||||
|
},
|
||||||
"proto": {
|
"proto": {
|
||||||
"revision": "e9f6b43f6844bd2189b50a422d4e2094313f6aa3"
|
"revision": "e9f6b43f6844bd2189b50a422d4e2094313f6aa3"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1385,6 +1385,15 @@ list.promql = {
|
||||||
maintainers = { "@MichaHoffmann" },
|
maintainers = { "@MichaHoffmann" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.properties = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/ObserverOfTime/tree-sitter-properties",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
filetype = "jproperties",
|
||||||
|
maintainers = { "@ObserverOfTime" },
|
||||||
|
}
|
||||||
|
|
||||||
list.proto = {
|
list.proto = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/treywood/tree-sitter-proto",
|
url = "https://github.com/treywood/tree-sitter-proto",
|
||||||
|
|
|
||||||
28
queries/properties/highlights.scm
Normal file
28
queries/properties/highlights.scm
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
(key) @property
|
||||||
|
|
||||||
|
(value) @string
|
||||||
|
|
||||||
|
(value (escape) @string.escape)
|
||||||
|
|
||||||
|
((value) @boolean
|
||||||
|
(#any-of? @boolean "true" "false"))
|
||||||
|
|
||||||
|
((value) @number
|
||||||
|
(#lua-match? @number "^%d+$"))
|
||||||
|
|
||||||
|
(index) @number
|
||||||
|
|
||||||
|
(property [ "=" ":" ] @operator)
|
||||||
|
|
||||||
|
[ "${" "}" ] @punctuation.special
|
||||||
|
|
||||||
|
(substitution ":" @punctuation.special)
|
||||||
|
|
||||||
|
[ "[" "]" ] @punctuation.bracket
|
||||||
|
|
||||||
|
[ "." "\\" ] @punctuation.delimiter
|
||||||
|
|
||||||
|
((substitution (key) @constant)
|
||||||
|
(#lua-match? @constant "^[A-Z_][A-Z0-9_]*$"))
|
||||||
2
queries/properties/injections.scm
Normal file
2
queries/properties/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment"))
|
||||||
3
queries/properties/locals.scm
Normal file
3
queries/properties/locals.scm
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
(property (key) @definition)
|
||||||
|
|
||||||
|
(substitution (key) @reference)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue