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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 19 Dec 2023 18:52:47 +0200

> From: Yuan Fu <[email-masked]>
> Date: Mon, 18 Dec 2023 18:26:30 -0800
> Cc: Eli Zaretskii <[email-masked]>,
>  [email-masked]
> 
> > On Dec 18, 2023, at 4:24 PM, Denis Zubarev <[email-masked]> wrote:
> > 
> > Just FYI, my paperwork is done.
> > 
> 
> Great, applied! Closing this bug.

The new tests fail here:

    ELC      src/treesit-tests.elc

  In end of data:
  src/treesit-tests.el:1094:17: Warning: the function `treesit--thing-at' is not known to be defined.
  [...]
  Test treesit-search-subtree-backward-1 backtrace:
    (treesit--thing-at (point) "call")
    (treesit-search-subtree (treesit--thing-at (point) "call") #'(lambda
    (let ((node (treesit-search-subtree (treesit--thing-at (point) "call
    (closure (t) nil (let* ((fn-621 #'treesit-language-available-p) (arg
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name treesit-search-subtree-backward-1 :do
    ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
    ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
    ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
    ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
    eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
    command-line-1(("-L" ";." "-l" "ert" "-l" "src/treesit-tests.el" "--
    command-line()
    normal-top-level()
  Test treesit-search-subtree-backward-1 condition:
      (void-function treesit--thing-at)
     FAILED  24/25  treesit-search-subtree-backward-1 (0.000000 sec) at src/treesit-tests.el:1100
  Can't guess python-indent-offset, using defaults: 4
  Test treesit-search-subtree-forward-1 backtrace:
    (treesit--thing-at (point) "call")
    (treesit-search-subtree (treesit--thing-at (point) "call") #'(lambda
    (let ((node (treesit-search-subtree (treesit--thing-at (point) "call
    (closure (t) nil (let* ((fn-609 #'treesit-language-available-p) (arg
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name treesit-search-subtree-forward-1 :doc
    ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
    ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
    ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
    ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
    eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
    command-line-1(("-L" ";." "-l" "ert" "-l" "src/treesit-tests.el" "--
    command-line()
    normal-top-level()
  Test treesit-search-subtree-forward-1 condition:
      (void-function treesit--thing-at)
     FAILED  25/25  treesit-search-subtree-forward-1 (0.015625 sec) at src/treesit-tests.el:1086

The function treesit--thing-at is only available on master.