void (@NotNull String text) { writeCommandAction(myProject).run(() -> { final DocumentEx document = myResultEditor.getDocument(); document.setText(text); PsiDocumentManager.getInstance(myProject).commitDocument(myResultEditor.getDocument()); }); }