Iterator<Block> () { FormattingModelBuilder builder = LanguageFormatting.INSTANCE.forContext(getFile()); Assert.assertNotNull(builder); CodeStyleSettings settings = CodeStyle.getSettings(getProject()); FormattingModel model = builder.createModel(FormattingContext.create(getFile(), settings)); Block root = model.getRootBlock(); Document document = PsiDocumentManager.getInstance(getProject()).getDocument(getFile()); Assert.assertNotNull(document); return new NewLineBlocksIterator(root, document); }