Further along...

OK, I'm further along getting the PsiParser hooked up to our internal language parser (yes, I'm pursing that approach.)  I'm getting a class cast exception:

java.lang.ClassCastException: com.guidewire.intellij.gscript.BasicParseTreetoASTNodeAdapter cannot be cast to com.intellij.psi.impl.source.tree.TreeElement
    at com.intellij.psi.impl.source.tree.ChameleonElement.transform(ChameleonElement.java:26)
    at com.intellij.psi.impl.source.parsing.ChameleonTransforming.transformNoLock(ChameleonTransforming.java:42)
    at com.intellij.psi.impl.source.parsing.ChameleonTransforming.transform(ChameleonTransforming.java:9)
    at com.intellij.psi.impl.source.parsing.ChameleonTransforming.transformChildren(ChameleonTransforming.java:52)
    at com.intellij.psi.impl.source.parsing.ChameleonTransforming.transformChildren(ChameleonTransforming.java:40)
    at com.intellij.psi.impl.source.tree.CompositeElement.countChildren(CompositeElement.java:69)
    at com.intellij.psi.impl.source.tree.CompositeElement.getChildrenAsPsiElements(CompositeElement.java:212)
    at com.intellij.psi.impl.source.PsiFileImpl.getChildren(PsiFileImpl.java:278)
    at com.guidewire.intellij.gscript.PsiGScriptFile.getFirstChild(PsiGScriptFile.java:24)
    at com.intellij.psi.SingleRootFileViewProvider.findElementAt(SingleRootFileViewProvider.java:84)


So my question is: should BasicParseTreeToASTNodeAdapter (a class that simply wraps our parsers notion of a parse tree element) implement TreeElement, or should only the root parse tree representing the file implement it?

Stuff like this makes me wish I worked at JetBrains, so I could just see the code in ChameleonElement.  <smile/>

Cheers,
Carson

Please sign in to leave a comment.