Function: projectile--find-matching-file
projectile--find-matching-file is a byte-compiled function defined in
projectile.el.
Signature
(projectile--find-matching-file TEST-FILE)
Documentation
Return a list of impl files tested by TEST-FILE.
The precedence for determining implementation files to return is:
1. Use the project type's src-dir property if it's set to a function
2. Use the project type's related-files-fn property if set
3. Use the project type's src-dir property if it's set to a string
4. Default to a fallback which matches all project files against
projectile--test-to-impl-predicate
5. Fallback to swapping "test" for "src" in TEST-FILE if "test"
is a substring of TEST-FILE.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
(defun projectile--find-matching-file (test-file)
"Return a list of impl files tested by TEST-FILE.
The precedence for determining implementation files to return is:
1. Use the project type's src-dir property if it's set to a function
2. Use the project type's related-files-fn property if set
3. Use the project type's src-dir property if it's set to a string
4. Default to a fallback which matches all project files against
`projectile--test-to-impl-predicate'
5. Fallback to swapping \"test\" for \"src\" in TEST-FILE if \"test\"
is a substring of TEST-FILE."
(projectile--acond
((projectile--impl-file-from-src-dir-fn test-file) (list it))
((projectile--related-files-plist-by-kind test-file :impl)
(projectile--related-files-from-plist it))
((projectile--impl-file-from-src-dir-str test-file) (list it))
((projectile--best-or-all-candidates-based-on-parents-dirs
test-file (seq-filter
(projectile--test-to-impl-predicate test-file)
(projectile-current-project-files))) it)
((projectile--test-to-impl-dir-fallback test-file) (list it))))