Subject: bug#65813: closed (Re: bug#65813: [PATCH] Fix elixir-ts-mode with embedded heex)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 07 Sep 2023 23:07:01 +0000

Your bug report

#65813: [PATCH] Fix elixir-ts-mode with embedded heex

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
65813: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65813
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#65813: [PATCH] Fix elixir-ts-mode with embedded heex
From: Yuan Fu <[email-masked]>
To: john muhl <[email-masked]>
Cc: [email-masked]
Date: Thu, 7 Sep 2023 16:06:10 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

> On Sep 7, 2023, at 1:46 PM, john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors <[email-masked]> wrote:
> 
> Tags: patch
> 
> The elixir test with embedded heex fails after d05494a9ff8. Restoring
> the ‘(when (eq (treesit-parser-language parser) language)’ part fixes
> it. The call to ‘(treesit-parser-list language)’ was not working right
> either since t-p-l expects the optional argument to be a buffer but
> language is a string like "heex".
> 
From 2d7ea1119f12890350f0c04b1e6c70a9856e1f87 Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Thu, 7 Sep 2023 15:43:01 -0500
Subject: [PATCH] Check embedded languages use the correct parser

* lisp/treesit.el (treesit-update-ranges): Restore check to
ensure embedded languages are handled by the appropriate parser.
---
 lisp/treesit.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 6fefc122582..63515e7f45c 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -680,9 +680,11 @@ treesit-update-ranges
                             (treesit--merge-ranges
                              old-ranges new-ranges beg end)
                             (point-min) (point-max))))
-          (dolist (parser (treesit-parser-list language))
-            (treesit-parser-set-included-ranges
-             parser set-ranges))))))))
+          (dolist (parser (treesit-parser-list))
+            (when (eq (treesit-parser-language parser)
+                      language)
+              (treesit-parser-set-included-ranges
+               parser set-ranges)))))))))
 
 (defun treesit-parser-range-on (parser beg &optional end)
   "Check if PARSER's range covers the portion between BEG and END.
-- 
2.41.0

Thank you very much, John. I pushed a fix to master.

Yuan

Subject: [PATCH] Fix elixir-ts-mode with embedded heex
From: john muhl <[email-masked]>
To: [email-masked]
Cc: Yuan Fu <[email-masked]>
Date: Thu, 07 Sep 2023 15:46:47 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

The elixir test with embedded heex fails after d05494a9ff8. Restoring
the ‘(when (eq (treesit-parser-language parser) language)’ part fixes
it. The call to ‘(treesit-parser-list language)’ was not working right
either since t-p-l expects the optional argument to be a buffer but
language is a string like "heex".

>From 2d7ea1119f12890350f0c04b1e6c70a9856e1f87 Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Thu, 7 Sep 2023 15:43:01 -0500
Subject: [PATCH] Check embedded languages use the correct parser

* lisp/treesit.el (treesit-update-ranges): Restore check to
ensure embedded languages are handled by the appropriate parser.
---
 lisp/treesit.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 6fefc122582..63515e7f45c 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -680,9 +680,11 @@ treesit-update-ranges
                             (treesit--merge-ranges
                              old-ranges new-ranges beg end)
                             (point-min) (point-max))))
-          (dolist (parser (treesit-parser-list language))
-            (treesit-parser-set-included-ranges
-             parser set-ranges))))))))
+          (dolist (parser (treesit-parser-list))
+            (when (eq (treesit-parser-language parser)
+                      language)
+              (treesit-parser-set-included-ranges
+               parser set-ranges)))))))))
 
 (defun treesit-parser-range-on (parser beg &optional end)
   "Check if PARSER's range covers the portion between BEG and END.
-- 
2.41.0