use of com.intellij.psi.formatter.xml.HtmlPolicy in project intellij-community by JetBrains.
the class HtmlFormattingModelBuilder method createModel.
@Override
@NotNull
public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
final PsiFile psiFile = element.getContainingFile();
final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile);
return new XmlFormattingModel(psiFile, new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFile), null, null, new HtmlPolicy(settings, documentModel), null, null, false), documentModel);
}
use of com.intellij.psi.formatter.xml.HtmlPolicy in project intellij-community by JetBrains.
the class XhtmlFormattingModelBuilder method createModel.
@Override
@NotNull
public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
final PsiFile psiFile = element.getContainingFile();
final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile);
return new XmlFormattingModel(psiFile, new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFile), null, null, new HtmlPolicy(settings, documentModel), null, null, false), documentModel);
}
use of com.intellij.psi.formatter.xml.HtmlPolicy in project intellij-plugins by JetBrains.
the class HbFormattingModelBuilder method createTemplateLanguageBlock.
@Override
public TemplateLanguageBlock createTemplateLanguageBlock(@NotNull ASTNode node, @Nullable Wrap wrap, @Nullable Alignment alignment, @Nullable List<DataLanguageBlockWrapper> foreignChildren, @NotNull CodeStyleSettings codeStyleSettings) {
final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(node.getPsi().getContainingFile());
HtmlPolicy policy = new HtmlPolicy(codeStyleSettings, documentModel);
return HbTokenTypes.TAGS.contains(node.getElementType()) ? new HandlebarsTagBlock(node, wrap, alignment, this, codeStyleSettings, foreignChildren, policy) : new HandlebarsBlock(node, wrap, alignment, this, codeStyleSettings, foreignChildren, policy);
}
Aggregations