private void commentIndentAfterNewLine(IDocument d, DocumentCommand c)
    {

        if (c.offset == -1 || d.getLength() == 0) {
            return;
        }

        try {
            // find start of line
            int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
            IRegion info = d.getLineInformationOfOffset(p);
            int start = info.getOffset();

            // find white spaces
            int end = findEndOfWhiteSpace(d, start, c.offset);

            StringBuilder buf = new StringBuilder(c.text);
            if (end >= start) {
                String indentation = commentExtractLinePrefix(d, d.getLineOfOffset(c.offset));
                buf.append(indentation);
                if (end < c.offset) {
                    //If it is the single line comment '//', don't append '*'.
                    if (d.getChar(end) == '/' && d.getChar(end + 1) != '/') {
                        // SQL multi-line comment started on this line
                        buf.append(" * "); //$NON-NLS-1$

                        if (DBWorkbench.getPlatform().getPreferenceStore().getBoolean(
                            SQLPreferenceConstants.SQLEDITOR_CLOSE_COMMENTS)
                            && isNewComment(d, c.offset, partitioning) &&
                            !hasCloseCommentSlash(d, c, end)) { // already has comment close block
                            String lineDelimiter = getLineDelimiter(d);

                            String endTag = lineDelimiter + indentation + " */"; //$NON-NLS-1$
                            d.replace(c.offset, 0, endTag); //$NON-NLS-1$

                        }

                    }
                }
            }

            c.text = buf.toString();

        }
        catch (BadLocationException excp) {
            // stop work
        }
    }
Copies the indentation of the previous line and add a star. If the SQL multi-line comment just started on this
line add standard method tags and close the comment.

@param d the document to work on
@param c the command to deal with
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/indent/SQLCommentAutoIndentStrategy.java