@NotNull
    private SQLContentAssistant createContentAssistant(ISourceViewer sourceViewer) {
        DBPPreferenceStore store = editor.getActivePreferenceStore();

        final DBPPreferenceStore configStore = store;

        final SQLContentAssistant assistant = new SQLContentAssistant(editor);

        assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));

        // Set content assist processors for various content types.
        if (completionProcessor == null) {
            this.completionProcessor = new SQLCompletionProcessor(editor);
        }
        try {
            assistant.addContentAssistProcessor(completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
            assistant.addContentAssistProcessor(completionProcessor, SQLParserPartitions.CONTENT_TYPE_SQL_QUOTED);
            assistant.addContentAssistProcessor(completionProcessor, SQLParserPartitions.CONTENT_TYPE_SQL_STRING);
        } catch (Throwable e) {
            // addContentAssistProcessor API was added in 4.12
            // Let's support older Eclipse versions
            assistant.setContentAssistProcessor(completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
        }

        // Configure how content assist information will appear.
        configureContentAssistant(store, assistant);
        assistant.setSorter(new SQLCompletionSorter(editor));

        assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));

        //In the future, a preference page will be added to customize foreground and background.
        Color foreground = new Color(UIUtils.getDisplay(), 0, 0, 0);
        Color background = new Color(UIUtils.getDisplay(), 255, 255, 255);

        assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
        assistant.setContextInformationPopupForeground(foreground);
        assistant.setContextInformationPopupBackground(background);
        //Set auto insert mode.
        assistant.enableAutoInsert(store.getBoolean(SQLPreferenceConstants.INSERT_SINGLE_PROPOSALS_AUTO));
        assistant.setShowEmptyList(true);

        final DBPPreferenceListener prefListener = event -> {
            switch (event.getProperty()) {
                case SQLPreferenceConstants.ENABLE_AUTO_ACTIVATION:
                    assistant.enableAutoActivation(
                        SQLEditorUtils.isSQLSyntaxParserApplied(editor.getEditorInput())
                        && configStore.getBoolean(SQLPreferenceConstants.ENABLE_AUTO_ACTIVATION)
                    );
                    break;
                case SQLPreferenceConstants.AUTO_ACTIVATION_DELAY:
                    assistant.setAutoActivationDelay(configStore.getInt(SQLPreferenceConstants.AUTO_ACTIVATION_DELAY));
                    break;
                case SQLPreferenceConstants.INSERT_SINGLE_PROPOSALS_AUTO:
                    assistant.enableAutoInsert(configStore.getBoolean(SQLPreferenceConstants.INSERT_SINGLE_PROPOSALS_AUTO));
                    break;
            }
        };

        ((SQLCompletionProcessor) completionProcessor).initAssistant(assistant);

        configStore.addPropertyChangeListener(prefListener);
        editor.getTextViewer().getControl().addDisposeListener(
            e -> configStore.removePropertyChangeListener(prefListener));

        return assistant;
    }
Creates, initializes, and returns the ContentAssistant to use with this editor.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorSourceViewerConfiguration.java