-
Notifications
You must be signed in to change notification settings - Fork 62
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
Debug antlr in vscode with launch.json #233
Comments
It should start debugging the grammar you have specified in the launch config. Maybe it tries to start with the current grammar instead? You probably still have the launch config active. Try switching to a grammar tab and start again. If that works, there might be a bug in the debugger session creation. |
Hello Mike, |
If you see that "no interpreter data found" message it means that you should trigger a re-creation of that, by changing your grammar and saving it. You can also try to remove By "having the config active" I meant that this was your active editor tab. My suggestion was to switch to your grammar tab and try again to start debugging. This shouldn't be necessary as you have given a grammar (double check the path is correct!), but at least is worth a try. |
I renamed both lexer and grammar files, deleted After typing this, I tabbed back into VSCode and pressed F5, and I got hit with the same (By parser and lexer files, I'm referring to files that have Heres my launch.json: {
"version": "2.0.0",
"configurations": [
{
"name": "Debug ANTLR4 grammar",
"type": "antlr-debug",
"request": "launch",
"input": "input.txt",
"grammar": "myp.g4",
"startRule": "file",
"printParseTree": true,
"visualParseTree": true
}
]
} VSCode settings: {
"antlr4.generation": {
"mode": "internal",
"language": "Java",
"listeners": true,
"visitors": false
}
} For the record I'm very new to ANTLR |
Hi, |
I also got no output no error, when I pressed F5 in a non-.g4 file. Though this didn't happen always, I dont remember the exact circumstances. I'm on Windows 11 with WSL2 Ubuntu. |
@mike-lischke any insights on differences for win 10 and win 11 ? any clue for what it might be ? |
I also got problems on Windows 11, specifically the error "Could not launch debug session: the grammar contains issues.", I've tried deleting the directory and restarting in a lot of ways vscode but the same error kept appearing, and I know my grammar file and settings for the setup for debugging are fine because they are the literal same in another computer I have which has WInodws 10, and the extension works fine in there, it seems Windows 11 somehow gives problem to this extension |
Ok I've found the solution to it that may work for someone that is struggling with this |
Sounds like either a too long path or some special chars in it, that are not visible (e.g. zero width characters, which got removed when you copy/pasted the path around). |
I'm using vscode 1.84.0 and ANTLR4 grammar syntax support v2.4.2. I also installed Debugger for Java v0.55.0 and I have Java-11 installed.
The tokens, lexer and listener files are created. Now I want to launch a debug session using the launch.json to parse my file and debug. My launch.json looks like this:
`{
"version": "2.0.0",
"configurations":
[
}`
I'm getting this error:
How should I launch and debug my parser using vscode ?
The text was updated successfully, but these errors were encountered: