Unnamed repository; edit this file 'description' to name the repository.
Add CSV language and syntax highlighting (#11973)
Jaakko Paju 2025-02-10
parent ff012e8 · commit a19c95a
-rw-r--r--book/src/generated/lang-support.md1
-rw-r--r--languages.toml9
-rw-r--r--runtime/queries/csv/highlights.scm14
3 files changed, 24 insertions, 0 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index b97a1f41..451fc840 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -30,6 +30,7 @@
| cpp | ✓ | ✓ | ✓ | `clangd` |
| crystal | ✓ | ✓ | | `crystalline` |
| css | ✓ | | ✓ | `vscode-css-language-server` |
+| csv | ✓ | | | |
| cue | ✓ | | | `cuelsp` |
| cylc | ✓ | ✓ | ✓ | |
| d | ✓ | ✓ | ✓ | `serve-d` |
diff --git a/languages.toml b/languages.toml
index 7c2a5410..1aa43bc3 100644
--- a/languages.toml
+++ b/languages.toml
@@ -4139,3 +4139,12 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "fga"
source = { git = "https://github.com/matoous/tree-sitter-fga", rev = "5005e8dd976e1f67beb3d23204580eb6f8b4c965" }
+
+[[language]]
+name = "csv"
+file-types = ["csv"]
+scope = "source.csv"
+
+[[grammar]]
+name = "csv"
+source = { git = "https://github.com/weartist/rainbow-csv-tree-sitter", rev = "d3dbf916446131417e4c2ea9eb8591b23b466d27" }
diff --git a/runtime/queries/csv/highlights.scm b/runtime/queries/csv/highlights.scm
new file mode 100644
index 00000000..b4743d79
--- /dev/null
+++ b/runtime/queries/csv/highlights.scm
@@ -0,0 +1,14 @@
+(first)@type
+(second)@function
+(third)@constant
+(fourth)@operator
+(fifth)@type
+(sixth)@function
+(seventh)@constant
+
+[
+ ";"
+ ","
+ "|"
+] @punctuation.delimiter
+