From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock Date: Fri, 28 Apr 2023 13:05:51 +0300 Message-ID: <9b01dbad-e337-a23c-2341-2a0ca89792dc@gutov.dev> References: <83r0s7szfj.fsf@gnu.org> <077666b3-657b-4b35-b271-78d6bd26d2df@Spark> <80fa402e-058b-4144-ab1e-a7dd6301bb4d@Spark> <83edo6u5kj.fsf@gnu.org> <9dfa3e61-87b9-04cf-21e6-6049ee3fed41@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5367"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Cc: casouri@gmail.com, Eli Zaretskii , 63086@debbugs.gnu.org, Jimmy Wong To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 28 12:07:23 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 1psL0b-0001Bd-EY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Apr 2023 12:07:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psL0L-00019t-LM; Fri, 28 Apr 2023 06:07:05 -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 1psL0J-00019j-31 for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2023 06:07:03 -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 1psL0I-0003hv-8M for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2023 06:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1psL0H-0005qK-N2 for bug-gnu-emacs@gnu.org; Fri, 28 Apr 2023 06:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Apr 2023 10:07: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.168267636222374 (code B ref 63086); Fri, 28 Apr 2023 10:07:01 +0000 Original-Received: (at 63086) by debbugs.gnu.org; 28 Apr 2023 10:06:02 +0000 Original-Received: from localhost ([127.0.0.1]:60511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psKzK-0005oo-5R for submit@debbugs.gnu.org; Fri, 28 Apr 2023 06:06:02 -0400 Original-Received: from new3-smtp.messagingengine.com ([66.111.4.229]:35141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psKzI-0005oE-5S for 63086@debbugs.gnu.org; Fri, 28 Apr 2023 06:06:00 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id E29FD582527; Fri, 28 Apr 2023 06:05:54 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 28 Apr 2023 06:05:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1682676354; x=1682679954; bh=UwuFrogl/K++mjGKae3/HF1kUY6Ap6y+FGk gsmTMWXM=; b=a51rUx0Jvbi317MC5v8WFZrzh5CWVT+c93kh0xkSjqgHx4hGDJw h+8IFWjse1KaTOxuCYoeVtnXl1DUxo3ghNtMU6WlGqYndX2yhG9fABYPj40YsZQT 9wcf6pn49/sj8OzfSTEM5buPz1H7aReVYiv8zCwBdtaANqWJO7EHP98xCnZympco J4dSbytm8xXjKrP5WulLeVSBp7IdTezFk3NpiVTiNcAUxiUFSijmfKLSijNii4q/ stKzPtqTxwXGH0RLMP1GnEVHpBznYPRLcTzdBzv2C/GDGnHHc7YEToGJFC92Wnpp inCDMokjxY9MCp0bF+RbuKeCZ383hhR2JwA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1682676354; x=1682679954; bh=UwuFrogl/K++mjGKae3/HF1kUY6Ap6y+FGk gsmTMWXM=; b=AhsOXIexn3uWe3uHZmv37FiW8eoYYqYCwUYRqx36O/5Iyhoohww MRoMYjl0s///LxAQ96UhVtChqbvkPvTAq2bUg3co3jMSUGp6+hhg05oWQh9e+dAa lb4n3qBGTgBqvM0frlZ7wAWYCGd1+Ynpv96HK7AeQzxe7Pr2SMXJc5J+5XLFILhV H9rGm2t9F/CwH5B2MfNxB2udd8MsK77GQj8fJIFV0WYp41OU+uiEhAS6QJ1N2oQb KGSpEApSmOF1XZ2pbwZ8ZHw/urwG+tW7sz9Vilmxwn493IpqNxNQ9ZqACTg9GYO7 Od6idol8Fje8OXBFQzYOgSMFSQE9zutEpwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedukedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Apr 2023 06:05:52 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:260761 Archived-At: On 28/04/2023 04:35, Randy Taylor wrote: > Maybe I'm missing something, but doesn't treesit-query-string with an empty string do nothing and always error, since it queries on whatever string you pass in? It would return nil, not error (querying an empty buffer). And we should be checking for error. This is the part that java-ts-mode--string-highlight-helper got right, BTW. 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. > 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, then treesit-query-validate is the only option, right? treesit-query-validate pops a new buffer interactively in the case of failure, so it's not something we should use here.