Function: magit-todos-candidates

magit-todos-candidates is a natively compiled function defined in magit-todos.el.

Signature

(magit-todos-candidates)

Documentation

Return list of (DISPLAY . ITEM) candidates for e.g. Helm and Ivy.

Source Code

;; Defined in /nix/store/xy37aj9089qvbs5clw0qszpi3hrh3mxx-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-todos-20250928.1611/magit-todos.el
(defun magit-todos-candidates ()
  "Return list of (DISPLAY . ITEM) candidates for e.g. Helm and Ivy."
  ;; MAYBE: Update the cache appropriately from here.
  (if-let* ((magit-status-buffer (magit-get-mode-buffer 'magit-status-mode))
            (items (buffer-local-value 'magit-todos-item-cache magit-status-buffer)))
      ;; Use cached items.
      (cl-loop for item in items
               collect (magit-todos-item-cons item))
    ;; No cached items: run scan.
    (when-let* ((items (funcall magit-todos-scanner :sync t
                                :directory default-directory
                                :depth magit-todos-depth)))
      (cl-loop for item in items
               collect (magit-todos-item-cons item)))))