@Override
    public void customizeDocumentCommand(IDocument document, DocumentCommand command)
    {
        // Do not check for doit because it is disabled in LinkedModeUI (e.g. when braket triggers position group)
//        if (!command.doit) {
//            return;
//        }
        if (command.offset < 0) {
            return;
        }

        if (command.text != null && command.text.length() > MINIMUM_SOUCE_CODE_LENGTH) {
            if (syntaxManager.getPreferenceStore().getBoolean(SQLPreferenceConstants.SQL_FORMAT_EXTRACT_FROM_SOURCE)) {
                if (transformSourceCode(document, command)) {
                    DBeaverNotifications.showNotification(
                        DBeaverNotifications.NT_GENERIC,
                        "SQL transformation (click to undo)",
                        "SQL query was extracted from the source code",
                        DBPMessageType.INFORMATION,
                        () -> {
                            if (sourceViewer instanceof ITextOperationTarget) {
                                ((ITextOperationTarget) sourceViewer).doOperation(ITextOperationTarget.UNDO);
                            }
                        });
                }
            }
        } else if (command.length == 0 && command.text != null) {
            final boolean lineDelimiter = isLineDelimiter(document, command.text);
            boolean isKeywordCaseUpdated = false;
            try {
                boolean isPrevLetter = command.offset > 0 && Character.isJavaIdentifierPart(document.getChar(command.offset - 1));
                boolean isQuote = isIdentifierQuoteString(command.text);
                if (command.offset > 1 && isPrevLetter && !isQuote &&
                    (lineDelimiter || (command.text.length() == 1 && !Character.isJavaIdentifierPart(command.text.charAt(0)))) &&
                    syntaxManager.getPreferenceStore().getBoolean(SQLPreferenceConstants.SQL_FORMAT_KEYWORD_CASE_AUTO))
                {
                    IRegion lineRegion = document.getLineInformationOfOffset(command.offset);
                    String line = document.get(lineRegion.getOffset(), lineRegion.getLength()).trim();

                    if (!SQLUtils.isCommentLine(syntaxManager.getDialect(), line)) {
                        isKeywordCaseUpdated = updateKeywordCase(document, command);
                    }
                }
            } catch (BadLocationException e) {
                log.debug(e);
            }
            if (lineDelimiter) {
                smartIndentAfterNewLine(document, command, isKeywordCaseUpdated);
            }
        }
    }
Creates a new SQL auto indent strategy for the given document partitioning.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/indent/SQLAutoIndentStrategy.java