mike-lischke / vscode-antlr4

ANTLR4 language support for Visual Studio Code
http://www.soft-gems.net
MIT License
435 stars 61 forks source link

Split grammar not generating properly, and can't debug #232

Closed lwestfall closed 12 months ago

lwestfall commented 1 year ago

I have a project that went on the backburner for several months. After returning to it in the last couple of days (and the extension updating to the latest release presumably) it appears that my split grammar isn't being properly generated. This was working perfectly fine when I last worked on it around 8 months ago.

My grammar files can be found here for repro: https://github.com/lwestfall/TeXpressions/tree/main/src/Grammars

I don't have any extension setting overrides, just the defaults apply.

Symptoms:

It appears that the top level grammar file (TeXpression.g4), when opened, generates parser and lexer files for TeXpression, but not its import (Logic.g4) or any of the other dependent grammar files. I can go into each grammar file manually and the files generate, but when I try to debug I get this error:

Error: Debugger creation failed. You are either trying to debug an unsupported file type or no interpreter data has been generated yet for the given grammar.

launch.json (can also be found in the above linked repo):

{
  "version": "2.0.0",
  "configurations": [
    {
      "name": "Debug ANTLR4 grammar",
      "type": "antlr-debug",
      "request": "launch",
      "input": "src/antlr/input.txt",
      "grammar": "src/Grammars/TeXpression.g4",
      "startRule": "statement",
      "printParseTree": true,
      "visualParseTree": true
    }
  ]
}

Output log when opening TeXpression.g4:

[debug] Running Java with parameters: -jar c:\Users\westfalll.vscode\extensions\mike-lischke.vscode-antlr4-2.4.2\node_modules\antlr4ng-cli\antlr4-4.13.2-SNAPSHOT-complete.jar -Dlanguage=Java -message-format antlr -o c:\Users\westfalll\Source\TeXpressions\src\Grammars.antlr -no-listener -no-visitor -Xexact-output-dir c:\Users\westfalll\Source\TeXpressions\src\Grammars\TeXpression.g4 [debug] No lexer interpreter data found at [debug] No lexer interpreter data found at

lwestfall commented 1 year ago

Hi @mike-lischke, I don't mean to be annoying or impatient by pinging you, but is there anything I can do or provide that might help lead to a solution? I'm wondering if these symptoms are related to some of the other more recent issues that have been posted.

lwestfall commented 12 months ago

FYI I just packaged the vsix locally after your recent changes (realizing you might have good reason to hold off on publishing a new release) and can confirm that 2.4.3 fixes all of my symptoms.

mike-lischke commented 12 months ago

Ah excellent, thanks for the confirmation. Yes, I have yet to fix a number issues before I can release the next version and I don't want to do a release in haste.