use of org.intellij.plugins.markdown.lang.lexer.MarkdownLexerAdapter in project intellij-plugins by JetBrains.
the class MarkdownLazyElementType method doParseContents.
@Override
protected ASTNode doParseContents(@NotNull ASTNode chameleon, @NotNull PsiElement psi) {
final Project project = psi.getProject();
final Lexer lexer = new MarkdownLexerAdapter();
final CharSequence chars = chameleon.getChars();
final org.intellij.markdown.ast.ASTNode node = new MarkdownParser(MarkdownParserManager.FLAVOUR).parseInline(MarkdownElementType.markdownType(chameleon.getElementType()), chars, 0, chars.length());
final PsiBuilder builder = PsiBuilderFactory.getInstance().createBuilder(project, chameleon, lexer, getLanguage(), chars);
assert builder.getCurrentOffset() == 0;
new PsiBuilderFillingVisitor(builder).visitNode(node);
assert builder.eof();
return builder.getTreeBuilt().getFirstChildNode();
}
Aggregations