In many, if not all supported languages, tree-sitter-hl-mode's font locking does not honor the :extend attribute of a face. The :extend face attribute is used to send a highlight past the newline character in a line.
The easiest way to see this is to produce a // comment in a mode that supports it, such as c-mode. Set the font-lock-comment-face and tree-sitter-hl-face:comment:background to a color other than the default background. Then, observe as comments stop at the newline instead of the end of the frame.
tree-sitter-hl-mode Disabled (no bug)
tree-sitter-hl-mode Enabled (bug)
To reproduce this issue:
launch emacs 29.1 with emacs -q --load repro.el (code is below).
Create a blank c file, ensuring c-mode is set. Add a // comment to any line and hit enter.
Observe the comment terminates at the newline (before the right side of the frame).
Type M-xtree-sitter-hl-mode. Observe the comment goes to the right side of the frame.
Note that the same bug was also reported at https://github.com/emacs-tree-sitter/tree-sitter-langs/issues/302. Apologies for the inconvenience of a double-report: I am finding it a little challenging to track down the maintainer of tree-sitter-hl.el for the report, on github.
In many, if not all supported languages, tree-sitter-hl-mode's font locking does not honor the
:extend
attribute of a face. The :extend face attribute is used to send a highlight past the newline character in a line.The easiest way to see this is to produce a
//
comment in a mode that supports it, such as c-mode. Set thefont-lock-comment-face
andtree-sitter-hl-face:comment
:background
to a color other than the default background. Then, observe as comments stop at the newline instead of the end of the frame.tree-sitter-hl-mode Disabled (no bug)
tree-sitter-hl-mode Enabled (bug)
To reproduce this issue:
emacs -q --load repro.el
(code is below).//
comment to any line and hit enter.M-x
tree-sitter-hl-mode
. Observe the comment goes to the right side of the frame.Languages this bug exists in
Not a complete list, but:
repro.el
Note that the same bug was also reported at https://github.com/emacs-tree-sitter/tree-sitter-langs/issues/302. Apologies for the inconvenience of a double-report: I am finding it a little challenging to track down the maintainer of tree-sitter-hl.el for the report, on github.