Skip to content

Commit fd012ee

Browse files
committed
Set treesit-defun-type-regexp to help with defun navigation
It sets up navigation functions for beginning-of-defun and end-of-defun.
1 parent 3a8ab04 commit fd012ee

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

php-ts-mode.el

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,16 @@ Currently there are `php-mode' and `php-ts-mode'."
331331

332332
(setq-local treesit-defun-name-function #'php-ts-mode--defun-name)
333333

334+
;; Navigation
335+
(setq-local treesit-defun-type-regexp
336+
(regexp-opt '("class_declaration"
337+
"enum_declaration"
338+
"function_definition"
339+
"interface_declaration"
340+
"method_declaration"
341+
"namespace_definition"
342+
"trait_declaration")))
343+
334344
;; Font-lock.
335345
(setq-local treesit-font-lock-settings php-ts-mode--font-lock-settings)
336346
(setq-local treesit-font-lock-feature-list

0 commit comments

Comments
 (0)