-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Parser error reporting #231
Comments
A reasonable feature request. How do the other ones notice errors? Are they
continuously shelling out to hledger to parse the file?
…On Mon, 5 Sep 2022 at 19:42, Pranesh Prakash ***@***.***> wrote:
Other {h}ledger-language grammar add-ons (such as the grammar for Atom
<https://github.com/4ourbit/language-ledger#parser-error-reports>)
recognizes parser errors, and thus prevents you from making mistakes while
adding/editing entries.
It'd be great if this could be made an optional feature with an override
command.
—
Reply to this email directly, view it on GitHub
<#231>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZYOJPC4MMI7UF5LSZ26LV4W575ANCNFSM6AAAAAAQE2DKRI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I'm not a coder, but I believe this is the code which the Atom add-on uses: |
Right, looks like they call “ledger stats” whenever the file changes.
My hledger file is a few years of data and takes a few seconds to output.
If i set this up to call hledger on every save then my cpu usage would go
high and my laptop fan would turn on.
Maybe if there was a way to invoke hledger just for the current file
looking for syntax errors, rather than balance assertions etc too, could
use that.
…On Mon, 5 Sep 2022 at 21:08, Pranesh Prakash ***@***.***> wrote:
I'm not a coder, but I believe this is the code which the Atom add-on uses:
https://github.com/4ourbit/language-ledger/blob/master/lib/language-ledger.coffee#L46-L91
—
Reply to this email directly, view it on GitHub
<#231 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZYOPABKOL2A3V6KGIYKLV4XIBVANCNFSM6AAAAAAQE2DKRI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Related, see hledger-flycheck. Several seconds would be a problem though. For me it's instant (recent macbook, journal split by year)
|
And as per @simonmichael, |
Looks like hledger-flycheck emacs plugin invokes "hledger check" on the shell: https://github.com/DamienCassou/flycheck-hledger/blob/master/flycheck-hledger.el#L63 Thanks for the pointers. Let's try some benchmarks on my shiny new M1 (which should be a bit faster than my other laptop):
Looks like Some stats about my journal:
I imagine it'd be near-instant if I split by year. I don't really want to split by year though. Maybe to be quick, an extension could use |
The (3?) "Basic assertions" are always run, currently it's not possible to separate them.
|
Other {h}ledger-language grammar add-ons (such as the grammar for Atom) recognizes parser errors, and thus prevents you from making mistakes while adding/editing entries.
It'd be great if this could be made an optional feature with an override command.
The text was updated successfully, but these errors were encountered: