@Override
  public void preExpand(final @NotNull PsiFile file, final @NotNull 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());
      }));
    }
  }
@Override
  public void preExpand(final @NotNull PsiFile file, final @NotNull Editor editor)