From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#61913: java-ts-mode query error for string highlight, due to recent commit in tree-sitter-java. Date: Sat, 4 Mar 2023 01:27:29 -0800 Message-ID: <7F86A486-0C53-4649-8373-91E093A67A19@gmail.com> References: <23F92D53-993F-43D6-8A22-00F7AAE10505@gmail.com> <83h6v1at5y.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8508"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Vincenzo Pupillo , 61913@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 04 10:28:24 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pYOBj-00021J-Si for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Mar 2023 10:28:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYOBR-0004rV-IS; Sat, 04 Mar 2023 04:28:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYOBP-0004qp-Hv for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2023 04:28:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYOBP-00014Z-0J for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2023 04:28:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYOBO-0003L8-Eh for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2023 04:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Mar 2023 09:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61913 X-GNU-PR-Package: emacs Original-Received: via spool by 61913-submit@debbugs.gnu.org id=B61913.167792206912811 (code B ref 61913); Sat, 04 Mar 2023 09:28:02 +0000 Original-Received: (at 61913) by debbugs.gnu.org; 4 Mar 2023 09:27:49 +0000 Original-Received: from localhost ([127.0.0.1]:35245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYOBA-0003KZ-JS for submit@debbugs.gnu.org; Sat, 04 Mar 2023 04:27:48 -0500 Original-Received: from mail-pj1-f45.google.com ([209.85.216.45]:53760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYOB8-0003KK-Ah for 61913@debbugs.gnu.org; Sat, 04 Mar 2023 04:27:47 -0500 Original-Received: by mail-pj1-f45.google.com with SMTP id y2so4994438pjg.3 for <61913@debbugs.gnu.org>; Sat, 04 Mar 2023 01:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677922060; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cwQil4D8VnJ0o1gTU+uCjCgsqXuv7g9iIXbCw5/IR2o=; b=DtmpYFjUIIJPCUpv+ZoMivBfzm3nVYTa01BWSxqIjhAS7aWFGLXtDLMlQlGQeBKL9e oclHFHLPqgxp9HgVIAsWDDPni9CclvsSwbi02EI82Mxx2+coAh8SIoX0me+z3OMHzoaZ D5IWnVSl6JqjaHoxh1PR1WjZGhRYb1IXC3mJbNZBjhBn2lTaRVchneNgIv/3YVuuIvWz ID2pNmC68tPkuc0gJKPWPY/DrqSNP/ltFjR8jc43pd/nhtrEL7NH8fChaFSeqjvF0vWQ e3iXJNdMwaZO6vrJ7SIIirhveeIh+UzbBvIOThf5QJ2A/ZUDEJ3hww9MVXSlm+Ha7kXj pldA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677922060; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cwQil4D8VnJ0o1gTU+uCjCgsqXuv7g9iIXbCw5/IR2o=; b=gIwwdyq8Zk4CQ//e3gy16RDEWt2eUt8Vp8u35GvHM1xyYZeUeoZkdRJMlQy68liKoS A42vhpNd/eUiyDpagrXtiacErrbnwHvJAlpnV2L1eVxs7MJaf/AlSA5zsZEJzluAncFO +95WD7oACe0duTHqigi+k2YaHMm0fcSLr2Lcmbu9lhIr9Ufk+xn3GVfBa9zlb9kIDDZb keK7LxFLgqnXXPsR46c+sjD8pPxIBNPdlAXiyl/Yz/yYht7KeGfoHTSeAEMdKQDuZKd1 8t/nOBpHIWydnrZW6eDM0iIciveo+w5oL5Xa51WZH0CglINZH4wcex0sffU9tNUn1XUw S93w== X-Gm-Message-State: AO0yUKUq/tXpAu4+uaWqckilsDcNQKzwwPOaL+aoDjnKn9mGEHqXslHc 9E5ZFddJ9Oo5KIGF+dOJC5s= X-Google-Smtp-Source: AK7set/WvleGg8gjSs0lE5VT5QTLX7ILvLh9HKdu/eNTERrj5I6M2OYMNf8s4CsvbPbGBLLhwvvH7Q== X-Received: by 2002:a05:6a20:e20:b0:cb:fe3e:e33 with SMTP id ej32-20020a056a200e2000b000cbfe3e0e33mr4892126pzb.42.1677922060485; Sat, 04 Mar 2023 01:27:40 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id c1-20020a63d141000000b004dff15fc121sm2830540pgj.36.2023.03.04.01.27.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Mar 2023 01:27:40 -0800 (PST) In-Reply-To: <83h6v1at5y.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.400.51.1.1) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257262 Archived-At: > On Mar 3, 2023, at 11:10 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Fri, 3 Mar 2023 14:32:02 -0800 >> Cc: Eli Zaretskii , >> 61913@debbugs.gnu.org >>=20 >>>>> 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'") >>>>>=20 >>>>>=20 >>>>> The attached patch fixes the problem.=20 >>>>=20 >>>> Wouldn't removing text_block from our code cause problems if = someone >>>> uses tree-sitter-java from before the removal? >>>>=20 >>>> Is there a way to write code which handles text_block if it exists? >>>>=20 >>=20 >> Tree-sitter language grammars really need some versioning system. I >> wonder how do we propose such things to them tho... >=20 > That'd be hard, given that many of them don't even make releases. >=20 > It should be enough for our purposes to have a possibility of querying > the grammar about support for specific features. Then the version > will not matter, only the supported features will. Maybe we could do > that ourselves, on-the-fly, like we do with programs when we want to > know whether they support some command-line switch? We can test whether a node type exists in the grammar, by trying to = compile a query using that node type. If it returns successfully, then = the node type exists. But there are other assumptions we make about a = grammar, like =E2=80=9Cthe 2nd child of a if node must be the = condition=E2=80=9D. Hopefully these more subtle things don=E2=80=99t = change easily, because we can=E2=80=99t easily test them. Yuan