on master help sign in
Add ledger tree-sitter (#572)

Might need to update later since the current one highlight does not work very well yet.

commitaaccc9419a9710f13db3ddc0aad068e606667154 authorIvan Tham <pickfire@riseup.net> dateMon 16 Aug 2021, 10:03 (5 years ago) parent3bde65c
5 files changed+53
.gitmodules+4 helix-syntax/languages/tree-sitter-ledger+1 languages.toml+9 runtime/queries/ledger/highlights.scm+38 runtime/queries/ledger/injections.scm+1
.gitmodules+4
@@ -94,3 +94,7 @@
9494 path = helix-syntax/languages/tree-sitter-latex
9595 url = https://github.com/latex-lsp/tree-sitter-latex
9696 shallow = true
97+[submodule "helix-syntax/languages/tree-sitter-ledger"]
98+ path = helix-syntax/languages/tree-sitter-ledger
99+ url = https://github.com/cbarrete/tree-sitter-ledger
100+ shallow = true
helix-syntax/languages/tree-sitter-ledgernew file+1

Submodule changed.

languages.toml+9
@@ -205,6 +205,15 @@ file-types = ["java"]
205205roots = []
206206indent = { tab-width = 4, unit = " " }
207207
208+[[language]]
209+name = "ledger"
210+scope = "source.ledger"
211+injection-regex = "ledger"
212+file-types = ["ldg", "ledger", "journal"]
213+roots = []
214+comment-token = ";"
215+indent = { tab-width = 4, unit = " " }
216+
208217# [[language]]
209218# name = "haskell"
210219# scope = "source.haskell"
runtime/queries/ledger/highlights.scmnew file+38
@@ -0,0 +1,38 @@
1+[
2+ (comment)
3+ (note)
4+] @comment
5+
6+[
7+ (date)
8+ (interval)
9+ (quantity)
10+] @number
11+
12+((account) @field)
13+((commodity) @text.literal)
14+
15+"include" @include
16+
17+[
18+ "account"
19+ "alias"
20+ "assert"
21+ "check"
22+ "commodity"
23+ "def"
24+ "default"
25+ "end"
26+ "eval"
27+ "format"
28+ "nomarket"
29+ "note"
30+ "payee"
31+ "check"
32+ "A"
33+ "Y"
34+ "N"
35+ "D"
36+ "C"
37+ "P"
38+] @keyword
runtime/queries/ledger/injections.scmnew file+1
@@ -0,0 +1 @@
1+(comment) @comment