Function: projectile--find-other-file

projectile--find-other-file is a byte-compiled function defined in projectile.el.

Signature

(projectile--find-other-file &optional FLEX-MATCHING FF-VARIANT)

Documentation

Switch between files with the same name but different extensions.

With FLEX-MATCHING, match any file that contains the base name of current file. Other file extensions can be customized with the variable projectile-other-file-alist. With FF-VARIANT set to a defun, use that
instead of find-file. A typical example of such a defun would be
find-file-other-window or find-file-other-frame

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
(defun projectile--find-other-file (&optional flex-matching ff-variant)
  "Switch between files with the same name but different extensions.
With FLEX-MATCHING, match any file that contains the base name of current file.
Other file extensions can be customized with the variable
`projectile-other-file-alist'.  With FF-VARIANT set to a defun, use that
instead of `find-file'.   A typical example of such a defun would be
`find-file-other-window' or `find-file-other-frame'"
  (let ((ff (or ff-variant #'find-file))
        (other-files (projectile-get-other-files (buffer-file-name) flex-matching)))
    (if other-files
        (let ((file-name (projectile--choose-from-candidates other-files :caller 'projectile-read-file)))
          (funcall ff (expand-file-name file-name
                                        (projectile-project-root))))
      (error "No other file found"))))