PsiElement (ASTNode node) { IElementType type = node.getElementType(); if (type instanceof JavaStubElementType) { return ((JavaStubElementType<?, ?>)type).createPsi(node); } // This exception is caught in com.intellij.psi.impl.source.tree.injected.InjectionRegistrarImpl.findNewInjectionHost // Please, check that code if you make any changes here throw new IllegalArgumentException("Not a Java node: " + node + " (" + type + ", " + type.getLanguage() + ")"); }