void (final @NotNull Editor editor) { Document document = editor.getDocument(); EditorTestUtil.CaretAndSelectionState caretState = EditorTestUtil.extractCaretAndSelectionMarkers(document); EditorTestUtil.setCaretsAndSelection(editor, caretState); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); }