diff options
| author | Brian Ryall <brianryall@fastmail.com> | 2021-03-21 13:26:33 -0400 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2021-03-22 07:11:10 +0100 |
| commit | fb75f019416f49f8542cc443cbf164d72c0f6e49 (patch) | |
| tree | e7ae594226d4c654538248a5127e1a88efa05fc4 | |
| parent | 0c12ff67fe9ab53eb79f7eeb1bdd7135bcdf0902 (diff) | |
add support for beancount files
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 9 | ||||
| -rw-r--r-- | queries/beancount/folds.scm | 3 | ||||
| -rw-r--r-- | queries/beancount/highlights.scm | 26 | ||||
| -rw-r--r-- | queries/beancount/locals.scm | 3 |
4 files changed, 41 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 690348ff..d98daaee 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -498,6 +498,15 @@ list.r = { maintainers = { "@jimhester" }, } +list.beancout = { + install_info = { + url = "https://github.com/polarmutex/tree-sitter-beancount", + files = { "src/parser.c" }, + branch = "master", + }, + maintainers = { "@polarmutex" } +} + local M = { list = list } diff --git a/queries/beancount/folds.scm b/queries/beancount/folds.scm new file mode 100644 index 00000000..25eb27b9 --- /dev/null +++ b/queries/beancount/folds.scm @@ -0,0 +1,3 @@ +[ + (transaction) +] @fold diff --git a/queries/beancount/highlights.scm b/queries/beancount/highlights.scm new file mode 100644 index 00000000..d16b586a --- /dev/null +++ b/queries/beancount/highlights.scm @@ -0,0 +1,26 @@ + +(date) @field +(txn) @annotation + +(account) @type + +(amount) @number +(incomplete_amount) @number +(amount_tolerance) @number + +(currency) @property + +(key) @label +(string) @string + +(tag) @constant +(link) @constant + +(comment) @comment + +[ + (BALANCE) (OPEN) (CLOSE) (COMMODITY) (PAD) + (EVENT) (PRICE) (NOTE) (DOCUMENT) (QUERY) + (CUSTOM) (PUSHTAG) (POPTAG) (PUSHMETA) + (POPMETA) (OPTION) (INCLUDE) (PLUGIN) +] @keyword diff --git a/queries/beancount/locals.scm b/queries/beancount/locals.scm new file mode 100644 index 00000000..ffe5b264 --- /dev/null +++ b/queries/beancount/locals.scm @@ -0,0 +1,3 @@ +(transaction + (date) @definition.date + (txn_strings) @definition.payee) @definition.transaction |
