]> git.eshelyaron.com Git - emacs.git/commit
Recognize functions and macros as defuns in 'cmake-ts-mode'
authorJörg Bornemann <foss@jbornemann.de>
Sat, 17 Feb 2024 20:18:02 +0000 (21:18 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 28 Feb 2024 17:39:54 +0000 (18:39 +0100)
commit8feb8a1304e38c2008abc8e44782bcb3ccb09b70
tree36bd42acb8eccb690b1f2232a5630815128c25ff
parentbd4d194e01a9a72880c5ee71115678e75c463051
Recognize functions and macros as defuns in 'cmake-ts-mode'

* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--function-name):
Renamed to 'cmake-ts-mode--defun-name' since the function handles
now functions and macros.
(cmake-ts-mode--defun-name): Return text of the first 'argument'
node below 'function_def' and 'macro_def' nodes.
(cmake-ts-mode): Set up treesit-defun-type-regexp and
'treesit-defun-name-function'.  Change the imenu setup to
recognize macros too.  Since we have set up
'treesit-defun-name-function', we don't have to
pass 'cmake-ts-mode--function-name' anymore.  (Bug#69186)

To make `treesit-defun-at-point' work properly, we have to recognize
function_def/macro_def nodes, not the lower-level *_command nodes.

(cherry picked from commit 6b6761d534259ab4d5409e72754e46af13623dda)
lisp/progmodes/cmake-ts-mode.el