From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67117: [PATCH] Tree-sitter: fix an issue when searching subtree backward Date: Sun, 19 Nov 2023 11:15:58 +0200 Message-ID: <838r6ukss1.fsf@gnu.org> References: <87h6lruah2.fsf@yandex.ru> <83y1ezqhhk.fsf@gnu.org> <3B375BD3-CF92-4473-AC46-50D6052B79C2@gmail.com> <831qcmmh0e.fsf@gnu.org> <31EB2F37-286D-4910-958B-0152A85E970F@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16166"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67117@debbugs.gnu.org To: dvzubarev@yandex.ru, Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 19 10:17:19 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 1r4dvZ-0003zD-O1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Nov 2023 10:17:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4dvK-0001N0-9D; Sun, 19 Nov 2023 04:17:02 -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 1r4dvJ-0001Mq-2Z for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 04:17:01 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r4dvI-0007Fd-Px for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 04:17:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r4dvK-0004qN-2B for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2023 04:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Nov 2023 09:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67117-submit@debbugs.gnu.org id=B67117.170038538518572 (code B ref 67117); Sun, 19 Nov 2023 09:17:02 +0000 Original-Received: (at 67117) by debbugs.gnu.org; 19 Nov 2023 09:16:25 +0000 Original-Received: from localhost ([127.0.0.1]:49933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4duj-0004pU-Cg for submit@debbugs.gnu.org; Sun, 19 Nov 2023 04:16:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4duh-0004pG-P0 for 67117@debbugs.gnu.org; Sun, 19 Nov 2023 04:16:24 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4dua-0005sm-Sx; Sun, 19 Nov 2023 04:16:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=42kX4se2DAc5/CHOlZB6Y1HTYfQOwLe5ISN3Q13s+H4=; b=Pz/PIJ39FfnQmzc+orcY xVVtL6PsYbocJ00/luKwVopvqN96gX6WiObOIBZ3Y4dql/G6vGtf19idMB/XNDvamxkS6IkWTQzr4 pIn+mjeyqrKvfXsoVJE8g6oDPTPtThfCLtwyoLgWIrVT16F2Ki6FpcbPW5fYUZLIwMj4sWfwbfhS/ G4WevkXjKqv6IpqyY3CuMpufRw50p4/g7/TLuO7xCfmZg70ZEc3EH+Gb9x95lYXjY//dc4V656c4b z6QrFzkVdf7P0iz8UlJkkqDENq70chUKOpLg0TuVQ/DvUXAoQ2L5Nv0GGNMESfcFlRX5i50Q+ymEr ioglsJGLTpnotw==; In-Reply-To: <31EB2F37-286D-4910-958B-0152A85E970F@gmail.com> (message from Yuan Fu on Sat, 18 Nov 2023 22:13:49 -0800) 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:274601 Archived-At: > From: Yuan Fu > Date: Sat, 18 Nov 2023 22:13:49 -0800 > Cc: dvzubarev@yandex.ru, > 67117@debbugs.gnu.org > > > > > On Nov 18, 2023, at 9:47 PM, Eli Zaretskii wrote: > > > >> From: Yuan Fu > >> Date: Sat, 18 Nov 2023 10:47:47 -0800 > >> Cc: Denis Zubarev , > >> 67117@debbugs.gnu.org > >> > >> > >>>> Steps to reproduce the issue: > >>>> 1. emacs -Q > >>>> 2. M-x find-file /tmp/t.py > >>>> 3. paste to the buffer > >>>> > >>>> Temp(1, 2) > >>>> > >>>> 4. M-x python-ts-mode > >>>> 5. Call search-subtree with backward flag > >>>> M-x eval-expression (treesit-search-subtree > >>>> (treesit--thing-at (point) "call") > >>>> (lambda (n) (equal (treesit-node-type n ) "integer")) > >>>> t) > >>>> It should return the second int node (#), but it returns nil. > >>> > >>> Yuan, any comments to the patch and the issue in general? > >> > >> LGTM. Thanks Denis, and Eli :-) > > > > Should we install this on the emacs-29 branch or on master? > > Emacs-29, I’d say, since it’s a bug fix. I see that the added tests use treesit--thing-at, which is not available on the emacs-29 branch. So either we install the tests on master, or we replace treesit--thing-at in the tests with its body. WDYT?