Closed MrRainsdRop closed 1 year ago
Does it happen only once, or every time you open this project?
Does it happen only once, or every time you open this project?
Every time, and the error message is the same.
Does it happen only once, or every time you open this project?
Every time, and the error message is the same.
I tried to reproduce the problem, and here is my code:
grammar MyGrammar;
options {
language=Python2;
}
WS: [ \t\r\n]+ -> skip;
COMMA: ',';
NUMBER: [0-9]+;
math: NUMBER (COMMA NUMBER)*;
There are two problems: a bug in ANTLR itself (not the IntelliJ plugin), and a problem with your grammar.
When an exception is caught in CodeGenerator
, the following catch
is called:
catch (Exception e) {
g.tool.errMgr.toolError(ErrorType.CANNOT_CREATE_TARGET_GENERATOR, e, language);
return null;
}
But g
is null in LeftRecursiveRuleAnalyzer
:
// use codegen to get correct language templates; that's it though
codegenTemplates = CodeGenerator.create(tool, null, language).getTemplates();
@MrRainsdRop when I try to reproduce your issue, the following exception is thrown, causing the bug:
java.lang.ClassNotFoundException: org.antlr.v4.codegen.target.Python2Target PluginClassLoader(plugin=PluginDescriptor(name=ANTLR v4, id=org.antlr.intellij.plugin, descriptorPath=plugin.xml, path=~/Dev/projets/perso/intellij-plugin-v4/build/idea-sandbox/plugins/antlr-intellij-plugin-v4, version=next-SNAPSHOT, package=null, isBundled=false), packagePrefix=null, instanceId=16, state=active)
Unfortunately, the Python2 target was removed in ANTLR 4.13.1, I'm afraid you'll have to use Python3 instead.
@parrt could you transfer this issue to https://github.com/antlr/antlr4 please?
Copied the link over. https://github.com/antlr/antlr4/issues/4432. closing
After I upgraded the plugin version from 1.20 to 1.21, the plugin crashed after opening the project. Here is the error message:
The problem disappeared when I rolled back the version of the plugin to version 1.20. It looks like there are some issues in the update content of the new version.
Related version information: Error plug-in version: 1.21 IDE Information: Pycharm 2023.1.4(Community Edition)
If you need more information, please let me know.