private static ProposalsJobResultStatus evaluateJobResult(SQLCompletionRequest request, int jobProposalsOrigin, int currentCursorPosition) {
        // Proposals were successfully prepared by the job,
        // but they still might be a bit out-of-sync with the cursor position.
        if (jobProposalsOrigin > currentCursorPosition) {
            // There were removals earlier than completion list appeared on the screen, so
            // prepared proposals are not relevant anymore.
            if (currentCursorPosition < request.getDocumentOffset()) {
                // The cursor is positioned before the initial request offset.
                // Eclipse drops completions list in this case anyway.
                return ProposalsJobResultStatus.ABORT;
            } else {
                // The cursor is positioned before the initial request offset,
                // but the job handled some insertions, which were then removed.
                // Let's restart the job.
                return ProposalsJobResultStatus.INVALID;
            }
        } else if (jobProposalsOrigin < currentCursorPosition) {
            // There were extra insertions at the moment when the job didn't handle them on the fly.
//            String unconsideredInput = null;
//            try {
//                unconsideredInput = request.getDocument().get(jobProposalsOrigin, currentCursorPosition - jobProposalsOrigin);
//            } catch (BadLocationException e) {
//                log.error("Failed to prepare completion proposals", e);
//                return ProposalsJobResultStatus.ABORT;
//            }

//            if (IDENTIFIER_PART_PATTERN.matcher(unconsideredInput).matches()) {
                // The inserted text fragment can be considered as part of a certain word or identifier,
                // so it's enough to do proposals validation to filter them out.
                return ProposalsJobResultStatus.PARTIALLY_VALID;
//            } else {
//                // The word structure was disrupted by non-identifier characters, so lets restart the job.
//                return ProposalsJobResultStatus.INVALID;
//            }
        } else {
            return ProposalsJobResultStatus.VALID;
        }
    }
The SQL content assist processor. This content assist processor proposes text
completions and computes context information for a SQL content type.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/syntax/SQLCompletionProcessor.java