refactor(tree-sitter): centralize grammar config & hacks

Easier to track and maintain.
This commit is contained in:
Henrik Lissner
2025-08-27 00:35:39 +02:00
parent 6009c2b838
commit 3b58741522
18 changed files with 85 additions and 142 deletions

View File

@@ -83,16 +83,8 @@
:when (fboundp 'php-ts-mode) ; 30.1+ only
:defer t
:init
(set-tree-sitter! 'php-mode 'php-ts-mode
'((php :url "https://github.com/tree-sitter/tree-sitter-php"
:rev "v0.23.11"
:source-dir "php/src")
(phpdoc :url "https://github.com/claytonrcarter/tree-sitter-phpdoc")))
(set-tree-sitter! 'php-mode 'php-ts-mode '(php phpdoc))
:config
;; HACK: Rely on `major-mode-remap-defaults'.
(cl-callf2 rassq-delete-all 'php-ts-mode auto-mode-alist)
(cl-callf2 rassq-delete-all 'php-ts-mode interpreter-mode-alist)
(+php-common-config 'php-ts-mode))