void (@NotNull final PsiFile file, @NotNull final Editor editor) { ThreadingAssertions.assertEventDispatchThread(); if (isSemicolonNeeded(file, editor)) { ApplicationManager.getApplication().runWriteAction(() -> CommandProcessor.getInstance().runUndoTransparentAction(() -> { EditorModificationUtil.insertStringAtCaret(editor, ";", false, false); PsiDocumentManager.getInstance(file.getProject()).commitDocument(editor.getDocument()); })); } }