From e105b5e67df1a9bbd9d35a9aef4d40d0119d708d Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Fri, 23 Feb 2024 17:21:26 +0200 Subject: feat(properties): update parser & queries --- README.md | 2 +- lockfile.json | 2 +- lua/nvim-treesitter/parsers.lua | 4 ++-- queries/properties/highlights.scm | 16 +++++++++++----- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6823484b4..c25e98e3a 100644 --- a/README.md +++ b/README.md @@ -340,7 +340,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [printf](https://github.com/ObserverOfTime/tree-sitter-printf) (maintained by @ObserverOfTime) - [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] [properties](https://github.com/ObserverOfTime/tree-sitter-properties) (maintained by @ObserverOfTime) +- [x] [properties](https://github.com/tree-sitter-grammars/tree-sitter-properties) (maintained by @ObserverOfTime) - [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] [psv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq) diff --git a/lockfile.json b/lockfile.json index b6bc19876..9adbcbe67 100644 --- a/lockfile.json +++ b/lockfile.json @@ -501,7 +501,7 @@ "revision": "77625d78eebc3ffc44d114a07b2f348dff3061b0" }, "properties": { - "revision": "74e5d3c63d0da17c0800b3cf9090b24637ef6b59" + "revision": "189b3cc18d36871c27ebb0adcf0cddd123b0cbba" }, "proto": { "revision": "e9f6b43f6844bd2189b50a422d4e2094313f6aa3" diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 6209ccc84..59cef4d53 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1484,8 +1484,8 @@ list.promql = { list.properties = { install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-properties", - files = { "src/parser.c" }, + url = "https://github.com/tree-sitter-grammars/tree-sitter-properties", + files = { "src/parser.c", "src/scanner.c" }, }, filetype = "jproperties", maintainers = { "@ObserverOfTime" }, diff --git a/queries/properties/highlights.scm b/queries/properties/highlights.scm index d819e20a5..b9390be8c 100644 --- a/queries/properties/highlights.scm +++ b/queries/properties/highlights.scm @@ -13,7 +13,17 @@ ((value) @number (#lua-match? @number "^%d+$")) -(index) @number +((index) @number + (#lua-match? @number "^%d+$")) + +((substitution + (key) @constant) + (#lua-match? @constant "^[A-Z_][A-Z0-9_]*$")) + +(substitution + (key) @function + "::" @punctuation.special + (secret) @constant.macro) (property [ @@ -38,7 +48,3 @@ "." "\\" ] @punctuation.delimiter - -((substitution - (key) @constant) - (#lua-match? @constant "^[A-Z_][A-Z0-9_]*$")) -- cgit v1.2.3-70-g09d2