use of com.intellij.formatting.FormattingModel in project intellij-community by JetBrains.
the class AbstractNewLineBlocksIteratorTest method newLineBlockIterator.
@NotNull
protected static Iterator<Block> newLineBlockIterator() {
FormattingModelBuilder builder = LanguageFormatting.INSTANCE.forContext(myFile);
Assert.assertNotNull(builder);
CodeStyleSettings settings = CodeStyleSettingsManager.getInstance(getProject()).getCurrentSettings();
FormattingModel model = builder.createModel(myFile, settings);
Block root = model.getRootBlock();
Document document = PsiDocumentManager.getInstance(getProject()).getDocument(myFile);
Assert.assertNotNull(document);
return new NewLineBlocksIterator(root, document);
}
Aggregations