bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67117: [PATCH] Tree-sitter: fix an issue when searching subtree back


From: Denis Zubarev
Subject: bug#67117: [PATCH] Tree-sitter: fix an issue when searching subtree backward
Date: Sun, 19 Nov 2023 14:25:14 +0300

I replaced use of `treesit--thing-at` with `treesit-query-capture`, so it should be compatible with emacs-29
 
19.11.2023, 12:16, "Eli Zaretskii" <eliz@gnu.org>:
 From: Yuan Fu <casouri@gmail.com>
 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 <eliz@gnu.org> wrote:
 >
 >> From: Yuan Fu <casouri@gmail.com>
 >> Date: Sat, 18 Nov 2023 10:47:47 -0800
 >> Cc: Denis Zubarev <dvzubarev@yandex.ru>,
 >> 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 (#<treesit-node integer in 9-10>), 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?

Attachment: 0002-Fix-an-issue-when-searching-subtree-backward.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]