Function: eca-chat--resolve-path-token

eca-chat--resolve-path-token is a natively compiled function defined in eca-chat-context.el.

Signature

(eca-chat--resolve-path-token TOKEN)

Documentation

Resolve TOKEN to an existing absolute path, else nil.

TOKEN may be absolute, start with ~, or be relative to one of the session workspace roots (including ./ and ../ tokens).

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat-context.el
(defun eca-chat--resolve-path-token (token)
  "Resolve TOKEN to an existing absolute path, else nil.
TOKEN may be absolute, start with ~, or be relative to one of
the session workspace roots (including ./ and ../ tokens)."
  (when (and token (not (string-empty-p token)))
    (if (file-name-absolute-p token)
        (let ((expanded (directory-file-name (expand-file-name token))))
          (when (f-exists? expanded) expanded))
      (-some (lambda (root)
               (let ((expanded (directory-file-name (expand-file-name token root))))
                 (when (f-exists? expanded) expanded)))
             (eca--session-workspace-folders (eca-session))))))