From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.bugs Subject: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock Date: Tue, 02 May 2023 00:29:43 +0000 Message-ID: References: <80fa402e-058b-4144-ab1e-a7dd6301bb4d@Spark> <83edo6u5kj.fsf@gnu.org> <9dfa3e61-87b9-04cf-21e6-6049ee3fed41@gutov.dev> <9b01dbad-e337-a23c-2341-2a0ca89792dc@gutov.dev> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_cVc1hgjhPZMTEc19zLTAqQROwIBDvQlPcQFQYNNUa0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23542"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, Eli Zaretskii , 63086@debbugs.gnu.org, Jimmy Wong To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 02 02:31:38 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 1ptdvd-0005sf-1L for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 May 2023 02:31:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptdv5-0005v6-NR; Mon, 01 May 2023 20:31:03 -0400 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 1ptdv4-0005uj-3l for bug-gnu-emacs@gnu.org; Mon, 01 May 2023 20:31:02 -0400 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 1ptdv3-00054J-R2 for bug-gnu-emacs@gnu.org; Mon, 01 May 2023 20:31:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ptdv3-0004Bc-NX for bug-gnu-emacs@gnu.org; Mon, 01 May 2023 20:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 May 2023 00:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63086 X-GNU-PR-Package: emacs Original-Received: via spool by 63086-submit@debbugs.gnu.org id=B63086.168298740315935 (code B ref 63086); Tue, 02 May 2023 00:31:01 +0000 Original-Received: (at 63086) by debbugs.gnu.org; 2 May 2023 00:30:03 +0000 Original-Received: from localhost ([127.0.0.1]:41265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptdu6-00048h-CY for submit@debbugs.gnu.org; Mon, 01 May 2023 20:30:03 -0400 Original-Received: from mail-4018.proton.ch ([185.70.40.18]:16243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptdu2-00047y-VP for 63086@debbugs.gnu.org; Mon, 01 May 2023 20:30:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail3; t=1682987392; x=1683246592; bh=YSsK44G/zS9deBF4U2/pHE6Vf0Q2CAtbyjIepCxzpMg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Xv0JSQMDNotk2kyi4tbGZyKNoAKtmHtMtDIlS7zCOuRDrT99/hFdqxPW+PETOv3kG uM2iKWjGdGH+XasJKznhlyPCC+H0I/NLYlrGvYHjyAgPVcOQ8xZxjMbcjw6KUP4oju ntlZtrlhlRqGoJyeFerm/+uy+/CVl9uxRyOkaPKCUVNwDYwT+2+94FSIVl2XXryHEg TMngvZSTdCRJNyP/A5g1vZcynCKifvqgwpBVP9F89gH7ky14FUg5R9iq3kn49yhrXb 1K6S9TknTD6eyQMY27E7BlOh+QbnHWNt4MXScKUnB8pgDESXp9zKlpT3VioYH7r6as Iyu7rRVlaFg/Q== In-Reply-To: <9b01dbad-e337-a23c-2341-2a0ca89792dc@gutov.dev> Feedback-ID: 44397038:user:proton 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:260897 Archived-At: This is a multi-part message in MIME format. --b1_cVc1hgjhPZMTEc19zLTAqQROwIBDvQlPcQFQYNNUa0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Friday, April 28th, 2023 at 06:05, Dmitry Gutov wrote= : > On 28/04/2023 04:35, Randy Taylor wrote: >=20 > > Maybe I'm missing something, but doesn't treesit-query-string with an e= mpty string do nothing and always error, since it queries on whatever strin= g you pass in? >=20 >=20 > It would return nil, not error (querying an empty buffer). And we should > be checking for error. >=20 > This is the part that java-ts-mode--string-highlight-helper got right, BT= W. Sorry, I was operating under false assumptions and somehow convinced myself= that treesit-query-string with an empty string returning nil meant the que= ry wasn't supported, hence me thinking it achieved nothing. I am no longer = under such delusions :). >=20 > go-ts-mode--iota-query-supported-p in your patch relies on the condition > that the file, at the time the mode is enabled, already contains at > least one "iota" node. Good point. I've attached a patch using treesit-query-string with an empty = string. It now works properly when iota is missing but inserted later. >=20 > > In that case, wouldn't using treesit-query-capture directly be the best= ? I don't understand why it's not from reading that thread. If it isn't, th= en treesit-query-validate is the only option, right? >=20 >=20 > treesit-query-validate pops a new buffer interactively in the case of > failure, so it's not something we should use here. --b1_cVc1hgjhPZMTEc19zLTAqQROwIBDvQlPcQFQYNNUa0 Content-Type: text/x-patch; name=0001-go-ts-mode-Use-iota-query-only-if-supported-Bug-6308.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-go-ts-mode-Use-iota-query-only-if-supported-Bug-6308.patch RnJvbSBiMTE3NTc3M2Y4YThhYTBjYWNmMGIwZWNkZDZkMGQxYjNkN2VmNTA1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBSYW5keSBUYXlsb3IgPGRldkByanQuZGV2PgpEYXRlOiBXZWQs IDI2IEFwciAyMDIzIDExOjE1OjQ1IC0wNDAwClN1YmplY3Q6IFtQQVRDSF0gZ28tdHMtbW9kZTog VXNlIGlvdGEgcXVlcnkgb25seSBpZiBzdXBwb3J0ZWQgKEJ1ZyM2MzA4NikKCmlvdGEgcXVlcnkg c3VwcG9ydCB3YXMgYWRkZWQgb24gSmFudWFyeSA1LCAyMDIyLiAgVG8gc3VwcG9ydCBvbGRlcgp2 ZXJzaW9ucyBvZiB0aGUgdHJlZS1zaXR0ZXItZ28gZ3JhbW1hciAobGlrZSB0aGUgbGF0ZXN0IHRh Z2dlZCB2ZXJzaW9uLAp2MC4xOS4xLCB3aGljaCB3YXMgcmVsZWFzZWQgb24gTWFyY2ggMywgMjAy MSksIGNoZWNrIGlmIHRoZSBxdWVyeSBpcwpzdXBwb3J0ZWQgYmVmb3JlIHRyeWluZyB0byB1c2Ug aXQuCgoqIGxpc3AvcHJvZ21vZGVzL2dvLXRzLW1vZGUuZWwgKGdvLXRzLW1vZGUtLWlvdGEtcXVl cnktc3VwcG9ydGVkLXApOiBOZXcKZ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