From d284ea1e8dd6c954330fb534bfa4c0474c05b2b7 Mon Sep 17 00:00:00 2001 From: yunusey <107340417+yunusey@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:16:12 -0400 Subject: [PATCH] feat(csv): added csv/tsv support --- README.md | 4 ++-- queries/csv/context.scm | 5 +++++ queries/tsv/context.scm | 5 +++++ test/lang/test.csv | 20 ++++++++++++++++++++ test/lang/test.tsv | 20 ++++++++++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 queries/csv/context.scm create mode 100644 queries/tsv/context.scm create mode 100644 test/lang/test.csv create mode 100644 test/lang/test.tsv diff --git a/README.md b/README.md index c9a7f435..ae3cf7bb 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ Note: support for specific languages is strictly community maintained and can br - [x] `yaml` - [x] `yang` - [x] `zig` + - [x] `csv` + - [x] `tsv` @@ -140,7 +142,6 @@ Note: support for specific languages is strictly community maintained and can br - [ ] `cooklang` - [ ] `corn` - [ ] `cpon` - - [ ] `csv` - [ ] `cylc` - [ ] `desktop` - [ ] `dhall` @@ -332,7 +333,6 @@ Note: support for specific languages is strictly community maintained and can br - [ ] `tlaplus` - [ ] `tmux` - [ ] `todotxt` - - [ ] `tsv` - [ ] `turtle` - [ ] `twig` - [ ] `typespec` diff --git a/queries/csv/context.scm b/queries/csv/context.scm new file mode 100644 index 00000000..762933fa --- /dev/null +++ b/queries/csv/context.scm @@ -0,0 +1,5 @@ +(document + . + (row) + . + (row) @context.end) @context diff --git a/queries/tsv/context.scm b/queries/tsv/context.scm new file mode 100644 index 00000000..762933fa --- /dev/null +++ b/queries/tsv/context.scm @@ -0,0 +1,5 @@ +(document + . + (row) + . + (row) @context.end) @context diff --git a/test/lang/test.csv b/test/lang/test.csv new file mode 100644 index 00000000..dfbeca6d --- /dev/null +++ b/test/lang/test.csv @@ -0,0 +1,20 @@ +name {{CONTEXT}},age,city +Alice,30,Jakarta +Bob,25,London +Charlie,35,Paris +Derin,23,Bilecik +Eve,42,Berlin +Frank,31,Sydney +Grace,27,Mumbai +Hank,33,Cairo +Ilkkan,77,Istanbul +Jack,38,Madrid +Kate,26,Seoul +Leo,34,Dublin +Mary,33,New York +Nate,23,Lima +Olivia,44,Vienna +Pete,36,Athens +Quinn,30,Lisbon +Rose,27,Zurich +Sam {{CURSOR}},41,Prague diff --git a/test/lang/test.tsv b/test/lang/test.tsv new file mode 100644 index 00000000..43865a30 --- /dev/null +++ b/test/lang/test.tsv @@ -0,0 +1,20 @@ +name {{CONTEXT}} age city +Alice 30 Jakarta +Bob 25 London +Charlie 35 Paris +Derin 23 Bilecik +Eve 42 Berlin +Frank 31 Sydney +Grace 27 Mumbai +Hank 33 Cairo +Ilkkan 77 Istanbul +Jack 38 Madrid +Kate 26 Seoul +Leo 34 Dublin +Mary 33 New York +Nate 23 Lima +Olivia 44 Vienna +Pete 36 Athens +Quinn 30 Lisbon +Rose 27 Zurich +Sam {{CURSOR}} 41 Prague