emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60301: closed (29.0.60; Tree sitter fontify region over a range with


From: GNU bug Tracking System
Subject: bug#60301: closed (29.0.60; Tree sitter fontify region over a range with no children issue)
Date: Sun, 25 Dec 2022 02:48:02 +0000

Your message dated Sat, 24 Dec 2022 18:46:57 -0800
with message-id <3E862979-E95E-4459-80C1-822C398D0E27@gmail.com>
and subject line Re: bug#60301: 29.0.60; Tree sitter fontify region over a 
range  with no children issue
has caused the debbugs.gnu.org bug report #60301,
regarding 29.0.60; Tree sitter fontify region over a range with no children 
issue
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
60301: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60301
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 29.0.60; Tree sitter fontify region over a range with no children issue Date: Sat, 24 Dec 2022 18:50:01 +0200 User-agent: mu4e 1.9.3; emacs 29.0.60

Currently when there are no children in a range when calling
treesit--children-covering-range-recurse it will return a node, but treesit-font-lock-fontify-region expects a list. This happens when there
is a chunk of an embedded language within the range.

Something like this fixes the issue for me:

@@ -859,7 +871,10 @@ treesit--children-covering-range-recurse
        (push child result))
      (setq child (treesit-node-next-sibling child)))
    ;; If NODE has no child, keep NODE.
-    (or result node)))
+
+    ;; Either we have to force a list here or handle
+    ;; the result as either a list or NODE.
+    (or result (list node))))


Wilhelm



--- End Message ---
--- Begin Message --- Subject: Re: bug#60301: 29.0.60; Tree sitter fontify region over a range with no children issue Date: Sat, 24 Dec 2022 18:46:57 -0800
Wilhelm H Kirschbaum <wilhelm@floatpays.co.za> writes:

> Currently when there are no children in a range when calling
> treesit--children-covering-range-recurse it will return a node, but
> treesit-font-lock-fontify-region expects a list. This happens when
> there
> is a chunk of an embedded language within the range.
>
> Something like this fixes the issue for me:
>
> @@ -859,7 +871,10 @@ treesit--children-covering-range-recurse
>         (push child result))
>       (setq child (treesit-node-next-sibling child)))
>     ;; If NODE has no child, keep NODE.
> -    (or result node)))
> +
> +    ;; Either we have to force a list here or handle
> +    ;; the result as either a list or NODE.
> +    (or result (list node))))
>
>
> Wilhelm

Ah, right, thanks for the fix! I applied this change.

Yuan


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]