Function: cider-project-type
cider-project-type is a byte-compiled function defined in cider.el.
Signature
(cider-project-type &optional PROJECT-DIR)
Documentation
Determine the type of the project in PROJECT-DIR.
When multiple project file markers are present, check for a preferred build
tool in cider-preferred-build-tool, otherwise prompt the user to choose.
PROJECT-DIR defaults to the current project.
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider.el
(defun cider-project-type (&optional project-dir)
"Determine the type of the project in PROJECT-DIR.
When multiple project file markers are present, check for a preferred build
tool in `cider-preferred-build-tool', otherwise prompt the user to choose.
PROJECT-DIR defaults to the current project."
(let* ((choices (cider--identify-buildtools-present project-dir))
(multiple-project-choices (> (length choices) 1))
;; this needs to be a string to be used in `completing-read'
(default (symbol-name (car choices)))
;; `cider-preferred-build-tool' used to be a string prior to CIDER
;; 0.18, therefore the need for `cider-maybe-intern'
(preferred-build-tool (cider-maybe-intern cider-preferred-build-tool)))
(cond ((and multiple-project-choices
(member preferred-build-tool choices))
preferred-build-tool)
(multiple-project-choices
(intern
(completing-read
(format "Which command should be used (default %s): " default)
choices nil t nil nil default)))
(choices
(car choices))
;; TODO: Move this fallback outside the project-type check
;; if we're outside a project we fallback to whatever tool
;; is specified in `cider-jack-in-default' (normally clojure-cli)
;; `cider-jack-in-default' used to be a string prior to CIDER
;; 0.18, therefore the need for `cider-maybe-intern'
(t (cider-maybe-intern cider-jack-in-default)))))