on master help sign in
Add language: beancount (#3297)
4ce5a94Kyle L. Davis
book/src/generated/lang-support.md+1
@@ -1,6 +1,7 @@
1| Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP |
1| Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP |
2| --- | --- | --- | --- | --- |
2| --- | --- | --- | --- | --- |
3| bash | ✓ | | | `bash-language-server` |
3| bash | ✓ | | | `bash-language-server` |
4+| beancount | ✓ | | | |
4| c | ✓ | ✓ | ✓ | `clangd` |
5| c | ✓ | ✓ | ✓ | `clangd` |
5| c-sharp | ✓ | | | `OmniSharp` |
6| c-sharp | ✓ | | | `OmniSharp` |
6| cairo | ✓ | | | |
7| cairo | ✓ | | | |
languages.toml+13
@@ -599,6 +599,19 @@ indent = { tab-width = 4, unit = " " }
599name = "ledger"
599name = "ledger"
600source = { git = "https://github.com/cbarrete/tree-sitter-ledger", rev = "1f864fb2bf6a87fe1b48545cc6adc6d23090adf7" }
600source = { git = "https://github.com/cbarrete/tree-sitter-ledger", rev = "1f864fb2bf6a87fe1b48545cc6adc6d23090adf7" }
601
601
602+[[language]]
603+name = "beancount"
604+scope = "source.beancount"
605+injection-regex = "beancount"
606+file-types = ["beancount", "bean"]
607+roots = []
608+comment-token = ";"
609+indent = { tab-width = 2, unit = " " }
610+
611+[[grammar]]
612+name = "beancount"
613+source = { git = "https://github.com/polarmutex/tree-sitter-beancount", rev = "4cbd1f09cd07c1f1fabf867c2cf354f9da53cc4c" }
614+
602[[language]]
615[[language]]
603name = "ocaml"
616name = "ocaml"
604scope = "source.ocaml"
617scope = "source.ocaml"
runtime/queries/beancount/folds.scmnew file+4
@@ -0,0 +1,4 @@
1+[
2+ (transaction)
3+ (section)
4+] @fold
runtime/queries/beancount/highlights.scmnew file+49
@@ -0,0 +1,49 @@
1+(date) @variable.builtin
2+(txn) @variable.builtin
3+
4+(account) @type
5+
6+[
7+ (amount)
8+ (incomplete_amount)
9+ (amount_tolerance)
10+ (number)
11+] @constant.numeric
12+
13+
14+[(key_value) (key)] @variable.other.member
15+(string) @string
16+
17+[
18+ (currency)
19+ (tag)
20+ (link)
21+] @constant
22+
23+(comment) @comment
24+
25+[
26+ (minus)
27+ (plus)
28+] @operator
29+
30+[
31+ (balance) (open) (close) (commodity) (pad)
32+ (event) (price) (note) (document) (query)
33+ (custom) (pushtag) (poptag) (pushmeta)
34+ (popmeta) (option) (include) (plugin)
35+] @keyword
36+
37+
38+((headline item: (item) @markup.heading.6) @markup.heading.marker
39+ (#match? @markup.heading.marker "^\\*\\*\\*\\*\\*\\*"))
40+((headline item: (item) @markup.heading.5) @markup.heading.marker
41+ (#match? @markup.heading.marker "^\\*\\*\\*\\*\\*"))
42+((headline item: (item) @markup.heading.4) @markup.heading.marker
43+ (#match? @markup.heading.marker "^\\*\\*\\*\\*"))
44+((headline item: (item) @markup.heading.3) @markup.heading.marker
45+ (#match? @markup.heading.marker "^\\*\\*\\*"))
46+((headline item: (item) @markup.heading.2) @markup.heading.marker
47+ (#match? @markup.heading.marker "^\\*\\*"))
48+((headline item: (item) @markup.heading.1) @markup.heading.marker
49+ (#match? @markup.heading.marker "^\\*"))