intellij-plugin-v4
intellij-plugin-v4 copied to clipboard
Separated parser and lexer should share `gen` and maybe other properties
@bjansen I think we have an issue where I said the gen dir in the antlr properties on the parser but it's switching away from the Lexer that causes the generation of the .tokens file. Either we need to synchronize those preferences or check for separated grammar and use the one on the parser or something.
Are all split-out lexers required to have Lexer as a suffix or is that just a default? Wondering if we can look at the grammar file name and determine whether it's a lexer.
I think in config dialog code we can force it to share a common set of values. :) Hmm...are we assuming XParser and XLexer is only way to associated split grammar? I think so. In general antlr doesn't care. We have -lib and -o to worry about. Doc says "Previously we looked for the tokens vocab file in the -lib dir or in the output dir. New: also look in the directory containing the grammar, particularly if it it is specified with a path." Hmm... maybe we need -Xexact-output-dir also to force .tokens and other output into gen dir.
Ah! The plugin doc says "It works with combined grammars and separated but separated must be in same directory and named XParser.g4 and XLexer.g4." Make this easier.
Coming to the conclusion that maybe I should just leave things as is until I understand this problem and the source code better. Some tangled relationships in there.