You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right, normally you would walk a PSI tree using psiElement.getChildren(), then call child.getNode().getElementType() to know whick kind of node it is. You can't access an instance of ParserRuleContext, but you can do something like this:
varrules = PSIElementTypeFactory.getRuleIElementTypes(myLanguage);
if (child.getNode().getElementType().equals(rules.get(MyParser.RULE_myRule))) {
// `child` was created from a parser rule named `myRule`
}
ANTLRPsiNode
created viacreateElement
seems unable to obtainParserRuleContext
.I want to get child nodes by judging
ParserRuleContext
's type.But the child node is also a
ParserRuleContext
, I don’t know how to convert it to aPsiElement
The text was updated successfully, but these errors were encountered: