-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add language: beancount #3297
Add language: beancount #3297
Conversation
we need highlights for beancount create
and next step
it will be change |
Yeah, that issue is being handled here: polarmutex/tree-sitter-beancount#12 I'm still not familiar with tree-sitter or LSP and how they work but I did notice the missing checkbox when generating docs for highlighting. |
@erasin Thanks. I'm merging master and adding that now. Appreciate it. |
credit erasin
credit nvim-treesitter/nvim-treesitter
I haven't had time to check this against some beancount files, but everything looks good now. |
may be we need add
VS beancount support type of I use beancount for myself like this
|
@erasin But is that supported anywhere else? I'd rather not add built-in support to something just because Microsoft wants to get cute. |
It looks like either a typo or an old version of beancount |
Sublime allows |
@the-mikedavis Thanks. Updated it. |
(headline item: (item) @markup.heading.1) @markup.heading.marker could be used for marking headers |
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Erasin <erasinoo@gmail.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Copied verbatim to end of highlighting. Attempting to test now. |
beancount comments https://beancount.github.io/docs/beancount_language_syntax.html#comments header like this
hightlight :
In the beancount , header is like comment, It seems to borrow the org-mode syntax . it like header mark |
It's a little verbose but we could highlight headers of different levels for themes that take advantage of those (like the same syntax in org or ((headline item: (item) @markup.heading.3) @markup.heading.marker
(#match? @markup.heading.marker "^\\*\\*\\*"))
((headline item: (item) @markup.heading.2) @markup.heading.marker
(#match? @markup.heading.marker "^\\*\\*"))
((headline item: (item) @markup.heading.1) @markup.heading.marker
(#match? @markup.heading.marker "^\\*")) IIRC we use up to |
This looks to be noted in the documents as well as a good use of comments. Since I still haven't had time to get up to speed on this syntax, just let me know what you want and I'd be happy to make the change. |
It's pretty verbose but let's go for h1-h6: ((headline item: (item) @markup.heading.6) @markup.heading.marker
(#match? @markup.heading.marker "^\\*\\*\\*\\*\\*\\*"))
((headline item: (item) @markup.heading.5) @markup.heading.marker
(#match? @markup.heading.marker "^\\*\\*\\*\\*\\*"))
((headline item: (item) @markup.heading.4) @markup.heading.marker
(#match? @markup.heading.marker "^\\*\\*\\*\\*"))
((headline item: (item) @markup.heading.3) @markup.heading.marker
(#match? @markup.heading.marker "^\\*\\*\\*"))
((headline item: (item) @markup.heading.2) @markup.heading.marker
(#match? @markup.heading.marker "^\\*\\*"))
((headline item: (item) @markup.heading.1) @markup.heading.marker
(#match? @markup.heading.marker "^\\*")) |
CI seems to be having some networking issues (timeout on url request). Otherwise, made the changes. They look good, although I hope someone makes future changes if these settings are not idiomatic to beancount. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for workshopping the queries (and to you @erasin)!
@erasin @the-mikedavis Yes, thank you both. I've been going through the tree-sitter documentation, but I think it'll be a while before I can make heads or tails of the |
Co-authored-by: erasin <erasinoo@gmail.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com> Co-authored-by: Erasin <erasinoo@gmail.com>
Documentation: https://beancount.github.io/docs/index.html