private static boolean isNewComment(IDocument document, int commandOffset, String partitioning)
    {

        try {
            int lineIndex = document.getLineOfOffset(commandOffset) + 1;
            if (lineIndex >= document.getNumberOfLines()) {
                return true;
            }

            IRegion line = document.getLineInformation(lineIndex);
            ITypedRegion partition = TextUtilities.getPartition(document, partitioning, commandOffset, false);
            int partitionEnd = partition.getOffset() + partition.getLength();
            if (line.getOffset() >= partitionEnd) {
                return false;
            }

            if (document.getLength() == partitionEnd) {
                return true; // partition goes to end of document - probably a new comment
            }

            String comment = document.get(partition.getOffset(), partition.getLength());
            return comment.indexOf("/*", 2) != -1;

        }
        catch (BadLocationException e) {
            return false;
        }
    }
Guesses if the command operates within a newly created SQL multi-line comment or not. If in doubt, it will assume
that the SQL multi-line comment is new.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/indent/SQLCommentAutoIndentStrategy.java