ASTNode (@NotNull ASTNode chameleon, @NotNull PsiElement psi) { PsiFile file = psi.getContainingFile(); assert file != null : chameleon; final Project project = file.getProject(); final Language language = chameleon.getElementType().getLanguage(); final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(language); final Lexer lexer = createLexer(chameleon, project, psi.getLanguage()); final PsiBuilder builder = getBuilder(chameleon, project, parserDefinition, lexer, chameleon.getChars()); return parseAndGetTree(builder).getFirstChildNode(); }