Function: projectile-test-at-point-elixir-name

projectile-test-at-point-elixir-name is a byte-compiled function defined in projectile.el.

Signature

(projectile-test-at-point-elixir-name NODE)

Documentation

Return the test name for the Elixir call NODE.

Matches an ExUnit test\=/describe\= call whose first argument is a string.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260930.434/projectile.el
(defun projectile-test-at-point-elixir-name (node)
  "Return the test name for the Elixir `call' NODE.
Matches an ExUnit `test\\='/`describe\\=' call whose first argument is a
string."
  (when-let* ((target (treesit-node-child-by-field-name node "target"))
              (target-name (treesit-node-text target t)))
    (when (member target-name '("test" "describe"))
      (when-let* ((args (treesit-node-child-by-field-name node "arguments"))
                  (arg (treesit-node-child args 0 t)))
        (when (equal (treesit-node-type arg) "string")
          (let ((text (treesit-node-text arg t)))
            (if (> (length text) 1) (substring text 1 -1) text)))))))