Function: projectile-subprojects-from-scan

projectile-subprojects-from-scan is a byte-compiled function defined in projectile.el.

Signature

(projectile-subprojects-from-scan ROOT)

Documentation

Return the directories below ROOT that hold a project manifest.

What counts as a manifest comes from projectile-subproject-markers. The file listing of ROOT is what gets scanned, so the ignore rules apply as usual - the manifest of a vendored dependency does not turn it into a subproject.

This finds every manifest there is, which is the right answer when nothing declares the members and too generous when something does; see projectile-subprojects-from-manifest.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-subprojects-from-scan (root)
  "Return the directories below ROOT that hold a project manifest.

What counts as a manifest comes from `projectile-subproject-markers'.
The file listing of ROOT is what gets scanned, so the ignore rules apply
as usual - the manifest of a vendored dependency does not turn it into a
subproject.

This finds every manifest there is, which is the right answer when
nothing declares the members and too generous when something does; see
`projectile-subprojects-from-manifest'."
  (let* ((markers (projectile--subproject-markers))
         (marker-set (make-hash-table :test 'equal))
         (dirs (make-hash-table :test 'equal)))
    (dolist (marker markers)
      (puthash marker t marker-set))
    (dolist (file (projectile-project-files root))
      ;; The marker test first: it's a hash lookup against a name we
      ;; already have, while `file-name-directory' allocates - and this
      ;; runs over every file in the project.  A manifest sitting in the
      ;; root itself has no directory part, which is the project rather
      ;; than a subproject.
      (when (gethash (file-name-nondirectory file) marker-set)
        (when-let* ((dir (file-name-directory file)))
          (puthash dir t dirs))))
    (sort (hash-table-keys dirs) #'string<)))