]> git.eshelyaron.com Git - emacs.git/commit
Rework tree-sitter font-lock
authorYuan Fu <casouri@gmail.com>
Thu, 13 Oct 2022 21:44:42 +0000 (14:44 -0700)
committerYuan Fu <casouri@gmail.com>
Thu, 13 Oct 2022 21:44:42 +0000 (14:44 -0700)
commitaf288d813b3c31a528ddcbdce08f497855a56e94
tree3dd300e76e0d249b99812d385e18873f34d1088a
parentf0e9085a17be8866c123b120e3252c52845ec38e
Rework tree-sitter font-lock

Remove :toggle and :level, add :feature.

* lisp/progmodes/js.el (js--treesit-settings): Add :feature.
(js--treesit-enable): Set treesit-font-lock-feature-list.
* lisp/progmodes/python.el: Replace :level with :feature.
(python-mode): Set treesit-font-lock-feature-list.
* lisp/treesit.el (treesit-font-lock-feature-list): New variable.
(treesit-font-lock-settings): Change format.
(treesit-font-lock-rules): Remove :toggle and :level, add :feature.
(treesit-font-lock-recompute-features): New function.
(treesit-font-lock-fontify-region): Change to work with the new
format.
(treesit-font-lock-enable): Add call to
treesit-font-lock-recompute-features.  And improve the font-lock-mode
workaround.
lisp/progmodes/js.el
lisp/progmodes/python.el
lisp/treesit.el