Function: projectile--expand-member-globs
projectile--expand-member-globs is a byte-compiled function defined in
projectile.el.
Signature
(projectile--expand-member-globs ROOT PATTERNS)
Documentation
Expand PATTERNS relative to ROOT into a list of relative directory names.
PATTERNS are workspace member globs (packages/*, crates/core). Only
existing directories survive, and each comes back with a trailing slash.
Negated patterns - pnpm allows a leading ! - are dropped rather than
subtracted, which can only leave the answer too generous, never too
narrow.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260930.434/projectile.el
(defun projectile--expand-member-globs (root patterns)
"Expand PATTERNS relative to ROOT into a list of relative directory names.
PATTERNS are workspace member globs (`packages/*', `crates/core'). Only
existing directories survive, and each comes back with a trailing slash.
Negated patterns - pnpm allows a leading `!' - are dropped rather than
subtracted, which can only leave the answer too generous, never too
narrow."
(let ((default-directory root)
(dirs nil))
(dolist (pattern patterns)
(unless (string-prefix-p "!" pattern)
;; Two arguments only: the third is REGEXP, not a dotfile flag, and
;; passing it makes a glob be read as a regular expression.
(dolist (hit (file-expand-wildcards (directory-file-name pattern)))
(when (file-directory-p (expand-file-name hit root))
;; Re-spell the hit relative to ROOT rather than keeping it as
;; written. A `go.work' says `./api', and the leading `./' would
;; otherwise survive into a subproject name that matches none of
;; the project's file paths - leaving find-file-in-subproject
;; with nothing to offer.
(push (file-name-as-directory
(file-relative-name (expand-file-name hit root) root))
dirs)))))
(sort (delete-dups dirs) #'string<)))