Function: projectile-find-file-in-subproject

projectile-find-file-in-subproject is an autoloaded, interactive and byte-compiled function defined in projectile.el.

Signature

(projectile-find-file-in-subproject)

Documentation

Jump to a file in one of the current project's subprojects.

Prompts for the subproject first, so the file completion only covers that part of the repository.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
;;;###autoload
(defun projectile-find-file-in-subproject ()
  "Jump to a file in one of the current project's subprojects.
Prompts for the subproject first, so the file completion only covers
that part of the repository."
  (interactive)
  (let* ((project-root (projectile-acquire-root))
         (subprojects (projectile-project-subprojects project-root)))
    (unless subprojects
      (user-error "No subprojects found in %s" project-root))
    (let* ((subproject (projectile-completing-read "Subproject: " subprojects))
           ;; Narrow the project's own listing rather than indexing the
           ;; subdirectory afresh: it's already there, and indexing the
           ;; subdirectory as if it were a project of its own would drop
           ;; the project's ignore rules.
           (files (projectile--restrict-to-subdirs
                   (projectile-project-files project-root) (list subproject)))
           (file (projectile-completing-read "Find file: " files
                                             :caller 'projectile-read-file)))
      (find-file (expand-file-name file project-root))
      (run-hooks 'projectile-find-file-hook))))