public void testFormatOptimizeRearrangeVcsChanges() {
doTest(new ReformatCodeRunOptions(VCS_CHANGED_TEXT).setOptimizeImports(true).setRearrangeCode(true));
}
+
+ public void testReformatRearrange_NotBreaksCode_WhenCaretOnEmptyLine() {
+ doTest(new ReformatCodeRunOptions(WHOLE_FILE).setRearrangeCode(true));
+ }
public void testFormatSelection_DoNotTouchTrailingWhiteSpaces() {
//todo actually test is not working, and working test is not working
Document document = PsiDocumentManager.getInstance(myProject).getDocument(file);
if (document != null && Rearranger.EXTENSION.forLanguage(file.getLanguage()) != null) {
- Runnable command = prepareRearrangeCommand(file, ranges);
PsiDocumentManager.getInstance(myProject).doPostponedOperationsAndUnblockDocument(document);
+ PsiDocumentManager.getInstance(myProject).commitDocument(document);
+ Runnable command = prepareRearrangeCommand(file, ranges);
try {
CommandProcessor.getInstance().executeCommand(myProject, command, COMMAND_NAME, null);
}