Subject: bug#61913: closed (Re: bug#61913: java-ts-mode query error for string highlight, due to recent commit in tree-sitter-java.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 09 Mar 2023 10:26:02 +0000

Your bug report

#61913: java-ts-mode query error for string highlight, due to recent commit in tree-sitter-java.

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].

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

Subject: Re: bug#61913: java-ts-mode query error for string highlight, due to recent commit in tree-sitter-java.
From: Eli Zaretskii <[email-masked]>
To: Vincenzo Pupillo <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Thu, 09 Mar 2023 12:24:55 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Vincenzo Pupillo <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Mon, 06 Mar 2023 15:03:46 +0100
> 
> Is this patch okay? Please feel free to make any changes you see fit.

Thanks, installed on the emacs-29 branch.

Btw, this patch all but exhausts the amount of changes we can accept
from you without a copyright assignment.  Would you like to start you
legal paperwork of assigning the copyright to the FSF?  If yes, I will
send you the form to fill.

Subject: java-ts-mode query error for string highlight, due to recent commit in tree-sitter-java.
From: Vincenzo Pupillo <[email-masked]>
To: [email-masked]
Date: Thu, 02 Mar 2023 13:21:05 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi, 
a recent commit in tree-sitter-java (https://github.com/tree-sitter/tree-sitter-java/commit/2b3b776b953a34ccffb647dd89732db79690d4c5) 
removed "text_block" from grammar.js. This causes a bug in java-ts-mode when treesit-fon-lock-level is > 1

Error during redeployment: (jit-lock-function 8295) reported (treesit-query-error "Node type error at" 42 "(string_literal) @font-lock-string-face (text_block) @font-lock-string-face" "Debugging the query with `treesit-query-validate'")

The attached patch fixes the problem. 
Thank you very much.

Vincenzo

diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index d31d2d71c3..176636aa7c 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -183,7 +183,6 @@ java-ts-mode--font-lock-settings
    :override t
    :feature 'string
    `((string_literal) @font-lock-string-face
-     (text_block) @font-lock-string-face)
    :language 'java
    :override t
    :feature 'literal