Closed parrt closed 2 years ago
Seems to be a general issue with later IDEs. It looks like getAlphaSortKey()
is the problem as element
(type ParserRuleRefNode
) is not a PsiNamedElement
. I'm trying ideaVersion=IC-2020.2.1
:
@NotNull
@Override
public String getAlphaSortKey() {
return element instanceof PsiNamedElement ? ((PsiNamedElement) element).getName() : "";
}
The exception is here:
private static final Sorter PARSER_LEXER_RULE_SORTER = new Sorter() {
public Comparator<?> getComparator() {
return (o1, o2) -> {
String s1 = SorterUtil.getStringPresentation(o1);
String s2 = SorterUtil.getStringPresentation(o2);
// flip case of char 0 so it puts parser rules first
if ( Character.isLowerCase(s1.charAt(0)) ) { <---------- s1 is ""
ANTLR PLUGIN 1.17 which is pretty out of date with ANTLR. It has 4.9.1 not 4.9.3.
Intellij:
The A-Z sort button is dehighlighted.
I clicked on the button to its immediate left then A-Z again and got exception in plugin (not ANTLR tool):