/tree-sitter-hledger

A tree-sitter grammer for the hledger format

Primary LanguageJavaScriptMIT LicenseMIT

tree-sitter-hledger

A Tree Sitter grammer for the hledger journal format.

Motivation

While working with hledger files, I've found the editor integration to be subpar. ledger-mode is great, but is even more restrictive to non-technical folks than ledger already is. Many of the integrations for other editors are also subpar. For instance mariosangiorgio/vscode-ledger (no longer maintained) and mhansen/hledger-vscode still use incomplete tmLanguage syntaxes.

Eventually, I would like to use this to create a hledger autoformatter.

Roadmap

The general goal is full support for the hledger format as described in the official documentation. Missing features (in no particular order):

  • Secondary dates
  • Posting dates
  • Pipes in descriptions
  • Spaces in account names
  • Full parse all amounts
  • Virtual postings
  • Balance assertions
  • Balance assignments
  • Transaction pricing
  • Comments
  • Directives
  • Periodic rules
  • Auto-postings

Contributing

This is a side project for me. I'm happy to accept contributions as pull-requests but don't have time (or the energy) to answer issues. If you find a bug, please add it to the corpus or submit a fix.