aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-08-17 04:07:43 -0400
committerAmaan Qureshi <amaanq12@gmail.com>2023-08-17 11:15:54 -0400
commit17d3398b5bd0d0042e1a71ee1842a831399cae97 (patch)
tree102f19112583ffdcc031681b9d1a9a26e303088a
parentfeat: add BitBake (diff)
downloadnvim-treesitter-17d3398b5bd0d0042e1a71ee1842a831399cae97.tar
nvim-treesitter-17d3398b5bd0d0042e1a71ee1842a831399cae97.tar.gz
nvim-treesitter-17d3398b5bd0d0042e1a71ee1842a831399cae97.tar.bz2
nvim-treesitter-17d3398b5bd0d0042e1a71ee1842a831399cae97.tar.lz
nvim-treesitter-17d3398b5bd0d0042e1a71ee1842a831399cae97.tar.xz
nvim-treesitter-17d3398b5bd0d0042e1a71ee1842a831399cae97.tar.zst
nvim-treesitter-17d3398b5bd0d0042e1a71ee1842a831399cae97.zip
feat: add CSV, PSV, & TSV
-rw-r--r--README.md3
-rw-r--r--lockfile.json9
-rw-r--r--lua/nvim-treesitter/parsers.lua27
-rw-r--r--queries/csv/highlights.scm3
-rw-r--r--queries/psv/highlights.scm3
-rw-r--r--queries/rst/injections.scm10
-rw-r--r--queries/tsv/highlights.scm4
7 files changed, 54 insertions, 5 deletions
diff --git a/README.md b/README.md
index 8aa827f7a..263ed52d8 100644
--- a/README.md
+++ b/README.md
@@ -199,6 +199,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [cpon](https://github.com/amaanq/tree-sitter-cpon) (maintained by @amaanq)
- [x] [cpp](https://github.com/tree-sitter/tree-sitter-cpp) (maintained by @theHamsta)
- [x] [css](https://github.com/tree-sitter/tree-sitter-css) (maintained by @TravonteD)
+- [x] [csv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq)
- [x] [cuda](https://github.com/theHamsta/tree-sitter-cuda) (maintained by @theHamsta)
- [x] [cue](https://github.com/eonpatapon/tree-sitter-cue) (maintained by @amaanq)
- [x] [d](https://github.com/CyberShadow/tree-sitter-d) (experimental, maintained by @nawordar)
@@ -311,6 +312,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [promql](https://github.com/MichaHoffmann/tree-sitter-promql) (maintained by @MichaHoffmann)
- [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)
- [x] [pug](https://github.com/zealot128/tree-sitter-pug) (experimental, maintained by @zealot128)
- [x] [puppet](https://github.com/amaanq/tree-sitter-puppet) (maintained by @amaanq)
- [x] [PyPA manifest](https://github.com/ObserverOfTime/tree-sitter-pymanifest) (maintained by @ObserverOfTime)
@@ -358,6 +360,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) (maintained by @ahelwer, @susliko)
- [x] [todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) (experimental, maintained by @arnarg)
- [x] [toml](https://github.com/ikatyang/tree-sitter-toml) (maintained by @tk-shirasaka)
+- [x] [tsv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq)
- [x] [tsx](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka)
- [x] [turtle](https://github.com/BonaBeavis/tree-sitter-turtle) (maintained by @BonaBeavis)
- [x] [twig](https://github.com/gbprod/tree-sitter-twig) (maintained by @gbprod)
diff --git a/lockfile.json b/lockfile.json
index bb5303fe1..c557cbeea 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -77,6 +77,9 @@
"css": {
"revision": "5f2c94b897601b4029fedcce7db4c6d76ce8a128"
},
+ "csv": {
+ "revision": "1f584470170b708880b024142d901b05b2b2b602"
+ },
"cuda": {
"revision": "607851cc524d9f5b5a5cd31ad4044fd431cee54e"
},
@@ -413,6 +416,9 @@
"prql": {
"revision": "09e158cd3650581c0af4c49c2e5b10c4834c8646"
},
+ "psv": {
+ "revision": "1f584470170b708880b024142d901b05b2b2b602"
+ },
"pug": {
"revision": "a7ff31a38908df9b9f34828d21d6ca5e12413e18"
},
@@ -554,6 +560,9 @@
"toml": {
"revision": "8bd2056818b21860e3d756b5a58c4f6e05fb744e"
},
+ "tsv": {
+ "revision": "1f584470170b708880b024142d901b05b2b2b602"
+ },
"tsx": {
"revision": "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf"
},
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 847c07837..fed9b402d 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -289,6 +289,15 @@ list.css = {
maintainers = { "@TravonteD" },
}
+list.csv = {
+ install_info = {
+ url = "https://github.com/amaanq/tree-sitter-csv",
+ files = { "src/parser.c" },
+ location = "csv",
+ },
+ maintainers = { "@amaanq" },
+}
+
list.cuda = {
install_info = {
url = "https://github.com/theHamsta/tree-sitter-cuda",
@@ -1240,6 +1249,15 @@ list.prql = {
maintainers = { "@matthias-Q" },
}
+list.psv = {
+ install_info = {
+ url = "https://github.com/amaanq/tree-sitter-csv",
+ files = { "src/parser.c" },
+ location = "psv",
+ },
+ maintainers = { "@amaanq" },
+}
+
list.pug = {
install_info = {
url = "https://github.com/zealot128/tree-sitter-pug",
@@ -1631,6 +1649,15 @@ list.toml = {
maintainers = { "@tk-shirasaka" },
}
+list.tsv = {
+ install_info = {
+ url = "https://github.com/amaanq/tree-sitter-csv",
+ files = { "src/parser.c" },
+ location = "tsv",
+ },
+ maintainers = { "@amaanq" },
+}
+
list.tsx = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-typescript",
diff --git a/queries/csv/highlights.scm b/queries/csv/highlights.scm
new file mode 100644
index 000000000..de2213aa1
--- /dev/null
+++ b/queries/csv/highlights.scm
@@ -0,0 +1,3 @@
+; inherits: tsv
+
+"," @punctuation.delimiter
diff --git a/queries/psv/highlights.scm b/queries/psv/highlights.scm
new file mode 100644
index 000000000..b7303fe0b
--- /dev/null
+++ b/queries/psv/highlights.scm
@@ -0,0 +1,3 @@
+; inherits: tsv
+
+"|" @punctuation.delimiter
diff --git a/queries/rst/injections.scm b/queries/rst/injections.scm
index 4fc27225a..7155b2a9b 100644
--- a/queries/rst/injections.scm
+++ b/queries/rst/injections.scm
@@ -54,11 +54,11 @@
(#eq? @_type "math"))
; TODO: re-add when a parser for csv is added.
-; ((directive
-; name: (type) @_type
-; body: (body (content) @injection.content))
-; (#set! injection.language "csv")
-; (#eq? @_type "csv-table"))
+((directive
+ name: (type) @_type
+ body: (body (content) @injection.content))
+ (#set! injection.language "csv")
+ (#eq? @_type "csv-table"))
;; Special roles - prefix
diff --git a/queries/tsv/highlights.scm b/queries/tsv/highlights.scm
new file mode 100644
index 000000000..f1e14af87
--- /dev/null
+++ b/queries/tsv/highlights.scm
@@ -0,0 +1,4 @@
+(text) @string
+(number) @number
+(float) @float
+(boolean) @boolean