private static void shortenReferences(final Project project, final Editor editor, InsertionContext context, int offset) {
    PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
    final PsiElement element = context.getFile().findElementAt(offset);
    final GrDocMemberReference tagValue = PsiTreeUtil.getParentOfType(element, GrDocMemberReference.class);
    if (tagValue != null) {
      try {
        JavaCodeStyleManager.getInstance(project).shortenClassReferences(tagValue);
      }
      catch (IncorrectOperationException e) {
        LOG.error(e);
      }
    }
    PsiDocumentManager.getInstance(context.getProject()).commitAllDocuments();
  }
private static void shortenReferences(final Project project, final Editor editor, InsertionContext context, int offset)