debugging antlr4 mojo help needed #4123
Unanswered
chris-miner
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed that the problem list in vscode for my grammar doesn't update. So if there is an error in the .g4 file as reported by antlr4-maven-plugin and I change the file, I'll get new errors, but none of the old ones will go away.
Suppose, I have a spelling mistake in my Calc.g4 file:
This can't be found because the actual file is
CommonLexerRules.g4
Errors show up in the problems view of VSCode:
If I fix that error — replacing the 'z' with 's' — the problem is still listed in the problem view. Reloading the window doesn't remedy the problem. The same list of errors are shown. Quitting and restarting VSCode doesn't fix the problem. Re-saving the project pom does clear the errors.
I'm pretty sure that is not how it is supposed to work. There's closed issue on the vscode project that mentions:
So I attempted to debug this issue with the mojo — problems ensued. I found this basic guide to debugging a mojo in eclipse. The first step of building and installing the mojo failed in the tests with:
So I skipped tests
this got me a
4.11.2-SNAPSHOT
version installed which happens to have the same problem (I was using 4.9.3). When I opened Antlr4Mojo.java in my Calc project, I was able to set break points in the mojo and debug it. Well, I was able to step through the code and look for issues.Another oddity about the reporting is they are shown as related to the project pom, not the actual grammar file. For example:
Any idea where to look for issues?
Beta Was this translation helpful? Give feedback.
All reactions