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

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

Signature

(projectile--test-at-point-name RULE)

Documentation

Return the name of the test around point according to RULE, or nil.

Walk up the tree-sitter parse tree from the node at point; for every enclosing node whose type is in RULE's :node-types, call the rule's
:name-fn with the node and return its first non-nil result.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--test-at-point-name (rule)
  "Return the name of the test around point according to RULE, or nil.
Walk up the tree-sitter parse tree from the node at point; for every
enclosing node whose type is in RULE's `:node-types', call the rule's
`:name-fn' with the node and return its first non-nil result."
  (let ((node-types (plist-get rule :node-types))
        (name-fn (plist-get rule :name-fn))
        (node (treesit-node-at (point)))
        name)
    (while (and node (null name))
      (when (member (treesit-node-type node) node-types)
        (setq name (funcall name-fn node)))
      (setq node (treesit-node-parent node)))
    name))