@Override
    public void visitNewExpression(@NotNull PsiNewExpression expression) {
      appendStyledSpan(myBuffer, getHighlightingManager().getKeywordAttributes(), "new ");
      PsiType type = expression.getType();
      if (type != null) {
        generateType(myBuffer, type, expression);
      }
      PsiExpression[] dimensions = expression.getArrayDimensions();
      if (dimensions.length > 0) {
        int closeBracketIndex = myBuffer.length() - 1;
        while (closeBracketIndex > 0 && myBuffer.charAt(closeBracketIndex) != ']') closeBracketIndex--;
        LOG.assertTrue(myBuffer.charAt(closeBracketIndex) == ']');
        myBuffer.setLength(closeBracketIndex);
        for (int i = 0; i < dimensions.length; i++) {
          PsiExpression dimension = dimensions[i];
          dimension.accept(this);
          if (i + 1 != dimensions.length) appendStyledSpan(myBuffer, getHighlightingManager().getCommaAttributes(), ", ");
        }
        appendStyledSpan(myBuffer, getHighlightingManager().getBracketsAttributes(), "]");
      }
      else {
        expression.acceptChildren(this);
      }
    }
@Override
    public void visitNewExpression(@NotNull PsiNewExpression expression)