Function: cider-enable-flex-completion

cider-enable-flex-completion is an interactive and byte-compiled function defined in cider-completion.el.

Signature

(cider-enable-flex-completion)

Documentation

Enables flex (fuzzy) completion for CIDER in all buffers.

Only affects the cider completion category.`

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-completion.el
(defun cider-enable-flex-completion ()
  "Enables `flex' (fuzzy) completion for CIDER in all buffers.

Only affects the `cider' completion category.`"
  (interactive)
  (let ((found-styles (when-let ((cider (assq 'cider completion-category-overrides)))
                        (assq 'styles cider)))
        (found-cycle (when-let ((cider (assq 'cider completion-category-overrides)))
                       (assq 'cycle cider))))
    (setq completion-category-overrides (seq-remove (lambda (x)
                                                      (equal 'cider (car x)))
                                                    completion-category-overrides))
    (unless found-styles
      (setq found-styles '(styles basic)))
    (unless (member 'flex found-styles)
      ;; This expression makes sure that 'flex style has a priority over other
      ;; styles, see https://github.com/clojure-emacs/cider/pull/3696.
      (setq found-styles (apply #'list 'styles 'flex (cdr found-styles))))
    (add-to-list 'completion-category-overrides (apply #'list 'cider found-styles (when found-cycle
                                                                                    (list found-cycle))))))