Function: projectile-dir-files-alien-async
projectile-dir-files-alien-async is a byte-compiled function defined
in projectile.el.
Signature
(projectile-dir-files-alien-async DIRECTORY CALLBACK &optional VCS SUBDIRS)
Documentation
Asynchronous counterpart of projectile-dir-files-alien.
Runs the project's main indexing command for DIRECTORY without blocking
and funcalls CALLBACK with (FILES ERROR) - the same convention as
projectile-files-via-ext-command-async.
VCS and SUBDIRS are interpreted exactly as in
projectile-dir-files-alien. For git projects the cheap auxiliary
steps (collecting submodule files and removing deleted-but-unstaged
files) run synchronously once the main command finishes, inside the
sentinel - off the caller's critical path - so the assembled result
matches the synchronous function. Returns the main command's process.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-dir-files-alien-async (directory callback &optional vcs subdirs)
"Asynchronous counterpart of `projectile-dir-files-alien'.
Runs the project's main indexing command for DIRECTORY without blocking
and funcalls CALLBACK with (FILES ERROR) - the same convention as
`projectile-files-via-ext-command-async'.
VCS and SUBDIRS are interpreted exactly as in
`projectile-dir-files-alien'. For git projects the cheap auxiliary
steps (collecting submodule files and removing deleted-but-unstaged
files) run synchronously once the main command finishes, inside the
sentinel - off the caller's critical path - so the assembled result
matches the synchronous function. Returns the main command's process."
(let* ((vcs (or vcs (projectile-project-vcs directory)))
(command (projectile--alien-ext-command vcs directory)))
(if (eq vcs 'git)
(let ((fd (and projectile-git-use-fd
(projectile-fd-executable-for directory))))
(projectile-files-via-ext-command-async
directory command
(lambda (files err)
(if err
(funcall callback nil err)
(let* ((all (nconc files
;; Submodules run their own `git ls-files',
;; which never saw our exclusions.
(projectile--maybe-remove-ignored
directory
(projectile--restricted-sub-projects-files
directory vcs subdirs))))
(deleted (unless fd (projectile-git-deleted-files directory))))
(funcall callback
(if deleted
(let ((deleted-set (make-hash-table :test 'equal :size (length deleted))))
(dolist (f deleted) (puthash f t deleted-set))
(seq-remove (lambda (f) (gethash f deleted-set)) all))
all)
nil))))
subdirs))
(projectile-files-via-ext-command-async directory command callback subdirs))))