little function to let you copy the current function in any programming languages that has a #emacs 29 built-in's tree-sitter mode:
(defun my-copy-function-name-with-ts()
(interactive)
(let ((funcname
(substring-no-properties
(treesit-node-text
(treesit-node-child-by-field-name (treesit-defun-at-point) "name")))))
(kill-new funcname)
(message "Copied name: %s" funcname)))