aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-02-28 00:14:08 -0500
committerAmaan Qureshi <amaanq12@gmail.com>2023-03-01 02:56:14 -0500
commit5b9339f6f48acd7482a24884807c608fef401249 (patch)
tree85f78de347575eecd527b6385186420ce1e2b6ce
parentfix(qmldir): add to parsers.lua (diff)
downloadnvim-treesitter-5b9339f6f48acd7482a24884807c608fef401249.tar
nvim-treesitter-5b9339f6f48acd7482a24884807c608fef401249.tar.gz
nvim-treesitter-5b9339f6f48acd7482a24884807c608fef401249.tar.bz2
nvim-treesitter-5b9339f6f48acd7482a24884807c608fef401249.tar.lz
nvim-treesitter-5b9339f6f48acd7482a24884807c608fef401249.tar.xz
nvim-treesitter-5b9339f6f48acd7482a24884807c608fef401249.tar.zst
nvim-treesitter-5b9339f6f48acd7482a24884807c608fef401249.zip
feat: add PO
-rw-r--r--README.md1
-rw-r--r--lockfile.json3
-rw-r--r--lua/nvim-treesitter/parsers.lua8
-rw-r--r--queries/po/folds.scm9
-rw-r--r--queries/po/highlights.scm33
-rw-r--r--queries/po/injections.scm1
6 files changed, 55 insertions, 0 deletions
diff --git a/README.md b/README.md
index 558927a50..45edb3612 100644
--- a/README.md
+++ b/README.md
@@ -282,6 +282,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka)
- [x] [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) (experimental, maintained by @mikehaertl)
- [x] [pioasm](https://github.com/leo60228/tree-sitter-pioasm) (maintained by @leo60228)
+- [x] [po](https://github.com/erasin/tree-sitter-po) (maintained by @amaanq)
- [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] [proto](https://github.com/mitchellh/tree-sitter-proto) (maintained by @fsouza)
diff --git a/lockfile.json b/lockfile.json
index 41616f172..375ea2ab2 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -326,6 +326,9 @@
"pioasm": {
"revision": "924aadaf5dea2a6074d72027b064f939acf32e20"
},
+ "po": {
+ "revision": "d6aed225290bc71a15ab6f06305cb11419360c56"
+ },
"poe_filter": {
"revision": "80dc10195e26c72598ed1ab02cdf2d8e4c792e7b"
},
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index a06c1baea..743f0f3e5 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1048,6 +1048,14 @@ list.pioasm = {
maintainers = { "@leo60228" },
}
+list.po = {
+ install_info = {
+ url = "https://github.com/erasin/tree-sitter-po",
+ files = { "src/parser.c" },
+ },
+ maintainers = { "@amaanq" },
+}
+
list.poe_filter = {
install_info = {
url = "https://github.com/ObserverOfTime/tree-sitter-poe-filter",
diff --git a/queries/po/folds.scm b/queries/po/folds.scm
new file mode 100644
index 000000000..589696477
--- /dev/null
+++ b/queries/po/folds.scm
@@ -0,0 +1,9 @@
+[
+ (msgctxt)
+ (msgid)
+ (msgid_plural)
+ (msgstr)
+ (msgstr_plural)
+
+ (message)
+] @fold
diff --git a/queries/po/highlights.scm b/queries/po/highlights.scm
new file mode 100644
index 000000000..bddeb5ba9
--- /dev/null
+++ b/queries/po/highlights.scm
@@ -0,0 +1,33 @@
+; Keywords
+
+[
+ "msgctxt"
+ "msgid"
+ "msgid_plural"
+ "msgstr"
+ "msgstr_plural"
+] @keyword
+
+; Punctuation
+
+[ "[" "]" ] @punctuation.bracket
+
+; Literals
+
+(string) @string
+
+(escape_sequence) @string.escape
+
+(number) @number
+
+; Comments
+
+(comment) @comment @spell
+
+(comment (reference (text) @string.special.path))
+
+(comment (flag (text) @preproc))
+
+; Errors
+
+(ERROR) @error
diff --git a/queries/po/injections.scm b/queries/po/injections.scm
new file mode 100644
index 000000000..4bb7d675d
--- /dev/null
+++ b/queries/po/injections.scm
@@ -0,0 +1 @@
+(comment) @comment