GNU bug report logs - #67990
30.0.50; tree-sitter: treesit-node-field-name-for-child seems to be broken after recent changes

Previous Next

Package: emacs;

Reported by: Denis Zubarev <dvzubarev <at> yandex.ru>

Date: Sat, 23 Dec 2023 14:39:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67990 in the body.
You can then email your comments to 67990 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67990; Package emacs. (Sat, 23 Dec 2023 14:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Denis Zubarev <dvzubarev <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 23 Dec 2023 14:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Denis Zubarev <dvzubarev <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; tree-sitter: treesit-node-field-name-for-child seems to be
 broken after recent changes
Date: Sat, 23 Dec 2023 17:37:54 +0300
libtree-sitter is compiled from sources (latest version) 

Steps to reproduce:
1. emacs -Q
2. M-x find-file /tmp/t.py
3. Paste there
if (v is not None and #comment
    v > 0):
   pass
4. M-x python-ts-mode
5. M-x treesit-explore-mode
    python

Parse tree:
(module
 (if_statement if
  (parenthesized_expression (
   (boolean_operator
    left: (comparison_operator (identifier) operators: is not operators: is not operators: (none))
    operator: and operator: (comment)
    operator: (comparison_operator (identifier) operators: > operators: (integer)))
   ))
  condition: :
  condition:
   (block
    (pass_statement pass))))


Parse tree from the playground:
module [0, 0] - [4, 0]
  if_statement [0, 0] - [2, 7]
    condition: parenthesized_expression [0, 3] - [1, 10]
      boolean_operator [0, 4] - [1, 9]
        left: comparison_operator [0, 4] - [0, 17]
          identifier [0, 4] - [0, 5]
          none [0, 13] - [0, 17]
        comment [0, 22] - [0, 30]
        right: comparison_operator [1, 4] - [1, 9]
          identifier [1, 4] - [1, 5]
          integer [1, 8] - [1, 9]
    consequence: block [2, 3] - [2, 7]
      pass_statement [2, 3] - [2, 7]


Version from the playground has correctly assigned fields:
parenthesized_expression - condition:, block is labeled as
consequence:, the second comparison_operator - right:

I noticed this regression after 9874561f39e62c1c9fada6c2e013f93d9ea65729.
Quote from this commit "So turns out ts_node_field_name_for_child takes a named node index,"
It seems that was a bug in the libtree-sitter and they fixed it in
https://github.com/tree-sitter/tree-sitter/pull/2104
Unfortunately, there is no release with this fix yet.

I have tested various combinations of libtree-sitter and fix from 9874561f39:
With commit 9874561f39
libtree-sitter v0.20.8 - condition: and consequence: fields are wrongly assigned
libtree-sitter version with the fix* - most fields are broken

When reverting commit 9874561f39
libtree-sitter v0.20.8 - only right: field is wrong (points to the comment node)
libtree-sitter version with the fix* - ok


* tree-sitter version with the fix:
git clone https://github.com/tree-sitter/tree-sitter.git
git checkout 6d1904c221d15d2fcbe0b590ff0a3f96c692429f
It is needed to recompile grammar after changing the libtree-sitter version.



In GNU Emacs 30.0.50 (build 9, x86_64-pc-linux-gnu, GTK+ Version
 3.24.33, cairo version 1.16.0) of 2023-12-23 built on NUC-here
Repository revision: 9c86dd52475e0ad65359bc964fbe0d62b9d3e464
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.3 LTS

Configured using:
 'configure --with-modules --with-native-compilation=aot
 --with-imagemagick --with-json --with-tree-sitter --with-xft'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2
M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: ru_RU.UTF-8
  value of $LC_NUMERIC: ru_RU.UTF-8
  value of $LC_TIME: ru_RU.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Magit Log

Minor modes in effect:
  hide-mode-line-mode: t
  global-anzu-mode: t
  anzu-mode: t
  winum-mode: t
  dap-tooltip-mode: t
  dap-ui-many-windows-mode: t
  dap-ui-mode: t
  treemacs-filewatch-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  dap-auto-configure-mode: t
  dap-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  recentf-mode: t
  save-place-mode: t
  global-so-long-mode: t
  global-git-commit-mode: t
  projectile-mode: t
  which-key-mode: t
  savehist-mode: t
  better-jumper-mode: t
  global-company-mode: t
  company-mode: t
  vertico-mode: t
  marginalia-mode: t
  evil-goggles-mode: t
  evil-escape-mode: t
  evil-snipe-override-mode: t
  evil-snipe-mode: t
  pcre-mode: t
  server-mode: t
  gcmh-mode: t
  global-hl-line-mode: t
  hl-line-mode: t
  winner-mode: t
  smartparens-global-mode: t
  ws-butler-global-mode: t
  undo-fu-session-global-mode: t
  undo-fu-mode: t
  global-flycheck-mode: t
  persp-mode: t
  doom-modeline-mode: t
  solaire-global-mode: t
  solaire-mode: t
  hexl-follow-ascii: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  dtrt-indent-mode: t
  dirvish-override-dired-mode: t
  direnv-mode: t
  +lsp-optimization-mode: t
  evil-mode: t
  evil-local-mode: t
  +popup-mode: t
  override-global-mode: t
  general-override-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  window-divider-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/denin/.emacs.d/.local/straight/build-30.0.50/ivy/elpa hides /home/denin/.emacs.d/.local/straight/build-30.0.50/lispy/elpa
/home/denin/.emacs.d/.local/straight/build-30.0.50/transient/transient hides /usr/local/share/emacs/30.0.50/lisp/transient
/home/denin/.emacs.d/.local/straight/build-30.0.50/bind-key/bind-key hides /usr/local/share/emacs/30.0.50/lisp/bind-key
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-delight hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-delight
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-lint hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-lint
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-jump hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-jump
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-diminish hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-diminish
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-ensure hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-ensure
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-bind-key hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-bind-key
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-core hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-core
/home/denin/.emacs.d/.local/straight/build-30.0.50/project/project hides /usr/local/share/emacs/30.0.50/lisp/progmodes/project
/home/denin/.emacs.d/.local/straight/build-30.0.50/gdb-mi/gdb-mi hides /usr/local/share/emacs/30.0.50/lisp/progmodes/gdb-mi
/home/denin/.emacs.d/.local/straight/build-30.0.50/xref/xref hides /usr/local/share/emacs/30.0.50/lisp/progmodes/xref
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-ref hides /usr/local/share/emacs/30.0.50/lisp/org/ob-ref
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-irc hides /usr/local/share/emacs/30.0.50/lisp/org/ol-irc
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-crypt hides /usr/local/share/emacs/30.0.50/lisp/org/org-crypt
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-attach hides /usr/local/share/emacs/30.0.50/lisp/org/org-attach
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-mouse hides /usr/local/share/emacs/30.0.50/lisp/org/org-mouse
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-latex hides /usr/local/share/emacs/30.0.50/lisp/org/ob-latex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-eww hides /usr/local/share/emacs/30.0.50/lisp/org/ol-eww
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-ditaa hides /usr/local/share/emacs/30.0.50/lisp/org/ob-ditaa
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-groovy hides /usr/local/share/emacs/30.0.50/lisp/org/ob-groovy
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-compat hides /usr/local/share/emacs/30.0.50/lisp/org/org-compat
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-info hides /usr/local/share/emacs/30.0.50/lisp/org/ol-info
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-protocol hides /usr/local/share/emacs/30.0.50/lisp/org/org-protocol
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-footnote hides /usr/local/share/emacs/30.0.50/lisp/org/org-footnote
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-id hides /usr/local/share/emacs/30.0.50/lisp/org/org-id
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-biblatex hides /usr/local/share/emacs/30.0.50/lisp/org/oc-biblatex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-C hides /usr/local/share/emacs/30.0.50/lisp/org/ob-C
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-colview hides /usr/local/share/emacs/30.0.50/lisp/org/org-colview
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-calc hides /usr/local/share/emacs/30.0.50/lisp/org/ob-calc
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-octave hides /usr/local/share/emacs/30.0.50/lisp/org/ob-octave
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-java hides /usr/local/share/emacs/30.0.50/lisp/org/ob-java
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-js hides /usr/local/share/emacs/30.0.50/lisp/org/ob-js
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-R hides /usr/local/share/emacs/30.0.50/lisp/org/ob-R
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-ruby hides /usr/local/share/emacs/30.0.50/lisp/org/ob-ruby
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-css hides /usr/local/share/emacs/30.0.50/lisp/org/ob-css
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-odt hides /usr/local/share/emacs/30.0.50/lisp/org/ox-odt
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-man hides /usr/local/share/emacs/30.0.50/lisp/org/ol-man
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-perl hides /usr/local/share/emacs/30.0.50/lisp/org/ob-perl
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-org hides /usr/local/share/emacs/30.0.50/lisp/org/ox-org
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-html hides /usr/local/share/emacs/30.0.50/lisp/org/ox-html
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-gnuplot hides /usr/local/share/emacs/30.0.50/lisp/org/ob-gnuplot
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-entities hides /usr/local/share/emacs/30.0.50/lisp/org/org-entities
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-bibtex hides /usr/local/share/emacs/30.0.50/lisp/org/ol-bibtex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-goto hides /usr/local/share/emacs/30.0.50/lisp/org/org-goto
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob hides /usr/local/share/emacs/30.0.50/lisp/org/ob
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-inlinetask hides /usr/local/share/emacs/30.0.50/lisp/org/org-inlinetask
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-comint hides /usr/local/share/emacs/30.0.50/lisp/org/ob-comint
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-gnus hides /usr/local/share/emacs/30.0.50/lisp/org/ol-gnus
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-latex hides /usr/local/share/emacs/30.0.50/lisp/org/ox-latex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-version hides /usr/local/share/emacs/30.0.50/lisp/org/org-version
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-agenda hides /usr/local/share/emacs/30.0.50/lisp/org/org-agenda
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-lisp hides /usr/local/share/emacs/30.0.50/lisp/org/ob-lisp
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-matlab hides /usr/local/share/emacs/30.0.50/lisp/org/ob-matlab
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org hides /usr/local/share/emacs/30.0.50/lisp/org/org
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-maxima hides /usr/local/share/emacs/30.0.50/lisp/org/ob-maxima
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-lua hides /usr/local/share/emacs/30.0.50/lisp/org/ob-lua
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-refile hides /usr/local/share/emacs/30.0.50/lisp/org/org-refile
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-faces hides /usr/local/share/emacs/30.0.50/lisp/org/org-faces
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-python hides /usr/local/share/emacs/30.0.50/lisp/org/ob-python
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-loaddefs hides /usr/local/share/emacs/30.0.50/lisp/org/org-loaddefs
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-lint hides /usr/local/share/emacs/30.0.50/lisp/org/org-lint
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-docview hides /usr/local/share/emacs/30.0.50/lisp/org/ol-docview
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-md hides /usr/local/share/emacs/30.0.50/lisp/org/ox-md
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-man hides /usr/local/share/emacs/30.0.50/lisp/org/ox-man
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-indent hides /usr/local/share/emacs/30.0.50/lisp/org/org-indent
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-mobile hides /usr/local/share/emacs/30.0.50/lisp/org/org-mobile
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-scheme hides /usr/local/share/emacs/30.0.50/lisp/org/ob-scheme
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox hides /usr/local/share/emacs/30.0.50/lisp/org/ox
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-tangle hides /usr/local/share/emacs/30.0.50/lisp/org/ob-tangle
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-csl hides /usr/local/share/emacs/30.0.50/lisp/org/oc-csl
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-shell hides /usr/local/share/emacs/30.0.50/lisp/org/ob-shell
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-beamer hides /usr/local/share/emacs/30.0.50/lisp/org/ox-beamer
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-natbib hides /usr/local/share/emacs/30.0.50/lisp/org/oc-natbib
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-habit hides /usr/local/share/emacs/30.0.50/lisp/org/org-habit
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-emacs-lisp hides /usr/local/share/emacs/30.0.50/lisp/org/ob-emacs-lisp
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-persist hides /usr/local/share/emacs/30.0.50/lisp/org/org-persist
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-core hides /usr/local/share/emacs/30.0.50/lisp/org/ob-core
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-icalendar hides /usr/local/share/emacs/30.0.50/lisp/org/ox-icalendar
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-haskell hides /usr/local/share/emacs/30.0.50/lisp/org/ob-haskell
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-attach-git hides /usr/local/share/emacs/30.0.50/lisp/org/org-attach-git
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc hides /usr/local/share/emacs/30.0.50/lisp/org/oc
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-sed hides /usr/local/share/emacs/30.0.50/lisp/org/ob-sed
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-pcomplete hides /usr/local/share/emacs/30.0.50/lisp/org/org-pcomplete
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-koma-letter hides /usr/local/share/emacs/30.0.50/lisp/org/ox-koma-letter
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-list hides /usr/local/share/emacs/30.0.50/lisp/org/org-list
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-ctags hides /usr/local/share/emacs/30.0.50/lisp/org/org-ctags
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-dot hides /usr/local/share/emacs/30.0.50/lisp/org/ob-dot
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-rmail hides /usr/local/share/emacs/30.0.50/lisp/org/ol-rmail
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-forth hides /usr/local/share/emacs/30.0.50/lisp/org/ob-forth
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-sqlite hides /usr/local/share/emacs/30.0.50/lisp/org/ob-sqlite
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-cycle hides /usr/local/share/emacs/30.0.50/lisp/org/org-cycle
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-num hides /usr/local/share/emacs/30.0.50/lisp/org/org-num
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-src hides /usr/local/share/emacs/30.0.50/lisp/org/org-src
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-sql hides /usr/local/share/emacs/30.0.50/lisp/org/ob-sql
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-plot hides /usr/local/share/emacs/30.0.50/lisp/org/org-plot
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-clock hides /usr/local/share/emacs/30.0.50/lisp/org/org-clock
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-element hides /usr/local/share/emacs/30.0.50/lisp/org/org-element
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-ascii hides /usr/local/share/emacs/30.0.50/lisp/org/ox-ascii
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-mhe hides /usr/local/share/emacs/30.0.50/lisp/org/ol-mhe
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-table hides /usr/local/share/emacs/30.0.50/lisp/org/ob-table
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-plantuml hides /usr/local/share/emacs/30.0.50/lisp/org/ob-plantuml
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-texinfo hides /usr/local/share/emacs/30.0.50/lisp/org/ox-texinfo
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-ocaml hides /usr/local/share/emacs/30.0.50/lisp/org/ob-ocaml
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-datetree hides /usr/local/share/emacs/30.0.50/lisp/org/org-datetree
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-doi hides /usr/local/share/emacs/30.0.50/lisp/org/ol-doi
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-macs hides /usr/local/share/emacs/30.0.50/lisp/org/org-macs
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-macro hides /usr/local/share/emacs/30.0.50/lisp/org/org-macro
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-basic hides /usr/local/share/emacs/30.0.50/lisp/org/oc-basic
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-fold hides /usr/local/share/emacs/30.0.50/lisp/org/org-fold
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-exp hides /usr/local/share/emacs/30.0.50/lisp/org/ob-exp
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-capture hides /usr/local/share/emacs/30.0.50/lisp/org/org-capture
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-fortran hides /usr/local/share/emacs/30.0.50/lisp/org/ob-fortran
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-lob hides /usr/local/share/emacs/30.0.50/lisp/org/ob-lob
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-awk hides /usr/local/share/emacs/30.0.50/lisp/org/ob-awk
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol hides /usr/local/share/emacs/30.0.50/lisp/org/ol
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-w3m hides /usr/local/share/emacs/30.0.50/lisp/org/ol-w3m
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-makefile hides /usr/local/share/emacs/30.0.50/lisp/org/ob-makefile
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-lilypond hides /usr/local/share/emacs/30.0.50/lisp/org/ob-lilypond
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-archive hides /usr/local/share/emacs/30.0.50/lisp/org/org-archive
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-processing hides /usr/local/share/emacs/30.0.50/lisp/org/ob-processing
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-eshell hides /usr/local/share/emacs/30.0.50/lisp/org/ob-eshell
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-julia hides /usr/local/share/emacs/30.0.50/lisp/org/ob-julia
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-sass hides /usr/local/share/emacs/30.0.50/lisp/org/ob-sass
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-screen hides /usr/local/share/emacs/30.0.50/lisp/org/ob-screen
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-bibtex hides /usr/local/share/emacs/30.0.50/lisp/org/oc-bibtex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-duration hides /usr/local/share/emacs/30.0.50/lisp/org/org-duration
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-org hides /usr/local/share/emacs/30.0.50/lisp/org/ob-org
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-tempo hides /usr/local/share/emacs/30.0.50/lisp/org/org-tempo
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-bbdb hides /usr/local/share/emacs/30.0.50/lisp/org/ol-bbdb
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-fold-core hides /usr/local/share/emacs/30.0.50/lisp/org/org-fold-core
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-clojure hides /usr/local/share/emacs/30.0.50/lisp/org/ob-clojure
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-timer hides /usr/local/share/emacs/30.0.50/lisp/org/org-timer
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-keys hides /usr/local/share/emacs/30.0.50/lisp/org/org-keys
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-eval hides /usr/local/share/emacs/30.0.50/lisp/org/ob-eval
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-table hides /usr/local/share/emacs/30.0.50/lisp/org/org-table
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-eshell hides /usr/local/share/emacs/30.0.50/lisp/org/ol-eshell
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-publish hides /usr/local/share/emacs/30.0.50/lisp/org/ox-publish
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-feed hides /usr/local/share/emacs/30.0.50/lisp/org/org-feed
/home/denin/.emacs.d/.local/straight/build-30.0.50/soap-client/soap-inspect hides /usr/local/share/emacs/30.0.50/lisp/net/soap-inspect
/home/denin/.emacs.d/.local/straight/build-30.0.50/soap-client/soap-client hides /usr/local/share/emacs/30.0.50/lisp/net/soap-client
/home/denin/.emacs.d/.local/straight/build-30.0.50/eldoc/eldoc hides /usr/local/share/emacs/30.0.50/lisp/emacs-lisp/eldoc
/home/denin/.emacs.d/.local/straight/build-30.0.50/map/map hides /usr/local/share/emacs/30.0.50/lisp/emacs-lisp/map

Features:
(shadow sort jinx mail-extr emacsbug hide-mode-line
evil-collection-magit-todos magit-todos async code-review
code-review-actions code-review-comment code-review-section
code-review-bitbucket code-review-faces emojify evil-collection-apropos
apropos code-review-gitlab code-review-utils evil-collection-forge
forge-list forge-commands forge-semi forge-bitbucket buck forge-gogs
gogs forge-gitea gtea forge-gitlab glab forge-github forge-notify
forge-revnote forge-pullreq forge-issue forge-topic forge-post
forge-repo forge forge-core forge-db code-review-parse-hunk
code-review-github code-review-db uuidgen calc-misc calc-ext calc
calc-loaddefs calc-macs a code-review-interfaces deferred ghub-graphql
treepy gsexp ghub closql emacsql-sqlite emacsql-sqlite-common emacsql
emacsql-compiler treemacs-magit magit-bookmark magit-autoloads
evil-collection-magit magit-submodule magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit magit-repos git-gutter-fringe fringe-helper
git-gutter vc bug-reference macrostep-c cmacexp
evil-collection-macrostep macrostep rainbow-delimiters gnus-async
gnus-ml nndoc gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg nntp gnus-cache gnus-dup gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus
dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int
gnus-range gnus-win evil-collection-gnus gnus nnheader range
evil-collection-tabulated-list mm-archive url-cache debbugs-gnu
debbugs-compat evil-collection-debbugs debbugs soap-client rng-xsd
rng-dt rng-util xsd-regexp org-capture org-agenda
the-org-mode-expansions evil-collection-org smartparens-org org-yt
org-element org-persist org-id org-refile org-element-ast avl-tree org
ob-emacs-lisp org-table org-loaddefs ob ob-tangle ol ob-ref ob-lob
ob-table ob-exp org-macro org-src evil-collection-sh-script sh-script
smie executable ob-comint org-pcomplete org-list org-footnote
org-entities evil-collection-calendar cal-menu calendar cal-loaddefs
evil-anzu anzu magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff magit-core magit-autorevert magit-margin
magit-transient magit-process magit-mode winum mule-util lsp-diagnostics
lsp-headerline lsp-icons lsp-modeline lsp-ui lsp-ui-flycheck lsp-ui-doc
evil-collection-lsp-ui-imenu lsp-ui-imenu lsp-ui-peek lsp-ui-sideline
lsp-ui-util lsp-zig lsp-tilt lsp-steep lsp-svelte lsp-sqls
lsp-ruby-syntax-tree lsp-ruby-lsp lsp-yaml lsp-xml lsp-vimscript
lsp-vhdl lsp-volar lsp-vetur lsp-html lsp-verilog lsp-vala lsp-v
lsp-typeprof lsp-ttcn3 lsp-toml lsp-terraform lsp-tex lsp-sorbet
lsp-solargraph lsp-semgrep lsp-rust lsp-rubocop lsp-rf lsp-ruff-lsp
lsp-remark lsp-racket lsp-r lsp-purescript lsp-pylsp lsp-pyls lsp-pwsh
lsp-php lsp-pls lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml
lsp-magik lsp-nix lsp-nim lsp-nginx lsp-move lsp-mint lsp-marksman
lsp-markdown lsp-lua lsp-kotlin lsp-json lsp-javascript lsp-idris
lsp-haxe lsp-groovy lsp-hack lsp-graphql lsp-glsl lsp-gleam lsp-go
lsp-completion lsp-gdscript lsp-fsharp lsp-fortran lsp-eslint lsp-erlang
lsp-emmet lsp-elixir lsp-elm lsp-dockerfile lsp-dhall lsp-d lsp-css
lsp-csharp gnutls lsp-crystal lsp-credo lsp-cmake lsp-clojure
lsp-semantic-tokens lsp-clangd lsp-beancount lsp-bash lsp-astro lsp-awk
lsp-ansible lsp-angular lsp-ada lsp-actionscript evil-collection-vc-git
vc-git vc-dispatcher jka-compr auto-minor-mode evil-ts-obj
evil-ts-obj-yaml evil-ts-obj-nix evil-ts-obj-cpp evil-ts-obj-bash
evil-ts-obj-python evil-ts-obj-avy evil-ts-obj-core evil-ts-obj-util
evil-ts-obj-conf cus-start outli org-faces org-keys oc lsp-pyright
dap-gdb-lldb dap-utils dap-lldb ccls ccls-member-hierarchy
ccls-inheritance-hierarchy ccls-call-hierarchy ccls-tree ccls-code-lens
ccls-semantic-highlight ccls-common smartparens-c cc-mode-expansions
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs dap-mouse dap-ui lsp-treemacs lsp-treemacs-generic
lsp-treemacs-themes treemacs-treelib treemacs-persp treemacs-projectile
treemacs-evil treemacs-nerd-icons treemacs treemacs-header-line
treemacs-compatibility treemacs-mode treemacs-bookmarks treemacs-tags
treemacs-interface treemacs-persistence treemacs-filewatch-mode
treemacs-follow-mode treemacs-rendering treemacs-annotations
treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator treemacs-faces treemacs-icons treemacs-scope
treemacs-themes treemacs-core-utils pfuture treemacs-logging
treemacs-customization treemacs-macros gdb-mi gdb-module hydra bui
bui-list bui-info bui-entry bui-core bui-history bui-button bui-utils
lsp-lens dap-python dap-mode dap-tasks dap-launch lsp-docker yaml
posframe dap-overlays lsp-mode lsp-protocol doom-snippets
doom-snippets-lib yasnippet flycheck-popup-tip evil-collection-popup
popup evil-collection-elisp-mode elisp-mode evil-collection-xref xref
spinner network-stream smartparens-markdown
evil-collection-markdown-mode markdown-mode edit-indirect noutline
outline lv inline ewoc vi-tilde-fringe display-line-numbers hl-todo
smartparens-python python-el-fgallina-expansions pyvenv
evil-collection-python python recentf tree-widget saveplace
evil-collection-so-long so-long git-commit magit-git magit-base
evil-collection-magit-section magit-section crm with-editor
evil-collection-log-edit log-edit message sendmail yank-media rfc822 mml
mml-sec evil-collection-epa epa epg rfc6068 epg-config gnus-util
mm-decode mm-bodies mm-encode mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log cursor-sensor delsel evil-collection-minibuffer
vertico-repeat tramp-sh jupyter-tramp tramp-cache time-stamp
jupyter-server jupyter-server-kernel jupyter-repl jupyter-widget-client
simple-httpd jupyter-client jupyter-kernel jupyter-kernelspec
jupyter-env jupyter-monads thunk jupyter-messages hmac-def jupyter-mime
shr pixel-fill kinsoku url-file svg xml jupyter-rest-api url-http
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-gw nsm puny websocket bindat jupyter-base eieio-base
tramp trampver tramp-integration tramp-message tramp-compat xdg
parse-time iso8601 time-date tramp-loaddefs projectile project
evil-collection-grep grep ibuffer-vc ibuf-ext evil-collection-ibuffer
ibuffer ibuffer-loaddefs evil-collection-which-key which-key savehist
better-jumper company-capf company-fuzzy ht ffap company
evil-collection-vertico vertico orderless marginalia evil-goggles
evil-easymotion evil-escape evil-snipe pcre2el rxt re-builder quail
ace-window avy evil-nerd-commenter evil-nerd-commenter-operator
evil-nerd-commenter-sdk smartparens-html html-mode-expansions sgml-mode
facemenu dom consult-flycheck evil-collection-consult consult
evil-collection-bookmark bookmark server pulse color autorevert
filenotify gcmh hl-line winner smartparens-config smartparens-text
smartparens loadhist ws-butler undo-fu-session undo-fu flycheck-package
package-lint evil-collection-imenu imenu evil-collection-finder finder
finder-inf lisp-mnt evil-collection-package-menu doom-packages package
browse-url url-handlers evil-collection-flycheck flycheck persp-mode
doom-modeline doom-modeline-segments doom-modeline-env
doom-modeline-core shrink-path f f-shortdoc shortdoc nerd-icons
nerd-icons-faces nerd-icons-data nerd-icons-data-mdicon
nerd-icons-data-flicon nerd-icons-data-codicon nerd-icons-data-devicon
nerd-icons-data-sucicon nerd-icons-data-wicon nerd-icons-data-faicon
nerd-icons-data-powerline nerd-icons-data-octicon
nerd-icons-data-pomicon nerd-icons-data-ipsicon doom-themes-ext-org
solaire-mode face-remap spacemacs-light-theme spacemacs-theme
chatgpt-shell shell-maker evil-collection-view view shell goto-addr
highlight-numbers parent-mode ielm find-func evil-collection-eshell
em-prompt eshell esh-mode esh-var esh-cmd generator esh-ext esh-opt
esh-proc esh-io esh-arg pcomplete esh-module esh-groups esh-util files-x
nhexl-mode disp-table hexl ascii-table evil-embrace embrace
expand-region text-mode-expansions er-basic-expansions
expand-region-core expand-region-custom evil-surround let-alist ob-core
org-cycle org-fold org-fold-core org-compat ob-eval org-version org-macs
turbo-log s evil-textobj-tree-sitter
evil-textobj-tree-sitter-thing-at-point evil-textobj-tree-sitter-core
treesit-langs treesit-faces treesit-langs-build dtrt-indent
evil-collection-tar-mode tar-mode evil-collection-arc-mode arc-mode
archive-mode url url-proxy url-privacy url-expand url-methods
url-history url-cookie generate-lisp-file url-domsuf url-util url-parse
auth-source password-cache url-vars mailcap treesit delight tree-sitter
tree-sitter-load tree-sitter-cli tsc tsc-dyn tsc-dyn-get
evil-collection-compile compile text-property-search
evil-collection-comint comint ansi-osc ansi-color dired-aux
dired-rainbow dired-hacks-utils dirvish transient format-spec eieio
eieio-core compat evil-collection-dired dired dired-loaddefs
tsc-obsolete direnv json map evil-collection-diff-mode
evil-collection-custom cus-edit cus-load wid-edit evil-collection
annalist diff-mode dash use-package-delight ibuf-macs targets evil
evil-integration evil-maps evil-commands reveal evil-jumps
evil-command-window evil-types evil-search evil-macros evil-repeat
evil-states evil-core advice evil-common thingatpt rect evil-vars ring
derived edmacro kmacro byte-opt use-package-bind-key bind-key comp
comp-cstr warnings icons comp-run comp-common rx doom-editor
doom-projects doom-ui easy-mmode doom-keybinds pp cl-extra help-mode
use-package-core bytecomp byte-compile general tex-site doom-start
doom-modules cl-seq doom doom-lib cl-macs cl-loaddefs cl-lib pcase gv
harfbuzz jansson dynamic-modules subr-x rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo gtk
x-toolkit xinput2 x multi-tty move-toolbar make-network-process
native-compile emacs)

Memory information:
((conses 16 1398587 358930) (symbols 48 104868 50) (strings 32 334857 37267)
 (string-bytes 1 11203917) (vectors 16 173893) (vector-slots 8 3342825 214963)
 (floats 8 1808 2246) (intervals 56 8608 1306) (buffers 992 33))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67990; Package emacs. (Thu, 28 Dec 2023 09:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 67990 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Denis Zubarev <dvzubarev <at> yandex.ru>, Yuan Fu <casouri <at> gmail.com>
Cc: 67990 <at> debbugs.gnu.org
Subject: Re: bug#67990: 30.0.50;
 tree-sitter: treesit-node-field-name-for-child seems to be broken
 after recent changes
Date: Thu, 28 Dec 2023 11:08:11 +0200
> From: Denis Zubarev <dvzubarev <at> yandex.ru>
> Date: Sat, 23 Dec 2023 17:37:54 +0300
> 
> 
> libtree-sitter is compiled from sources (latest version) 
> 
> Steps to reproduce:
> 1. emacs -Q
> 2. M-x find-file /tmp/t.py
> 3. Paste there
> if (v is not None and #comment
>     v > 0):
>    pass
> 4. M-x python-ts-mode
> 5. M-x treesit-explore-mode
>     python
> 
> Parse tree:
> (module
>  (if_statement if
>   (parenthesized_expression (
>    (boolean_operator
>     left: (comparison_operator (identifier) operators: is not operators: is not operators: (none))
>     operator: and operator: (comment)
>     operator: (comparison_operator (identifier) operators: > operators: (integer)))
>    ))
>   condition: :
>   condition:
>    (block
>     (pass_statement pass))))
> 
> 
> Parse tree from the playground:
> module [0, 0] - [4, 0]
>   if_statement [0, 0] - [2, 7]
>     condition: parenthesized_expression [0, 3] - [1, 10]
>       boolean_operator [0, 4] - [1, 9]
>         left: comparison_operator [0, 4] - [0, 17]
>           identifier [0, 4] - [0, 5]
>           none [0, 13] - [0, 17]
>         comment [0, 22] - [0, 30]
>         right: comparison_operator [1, 4] - [1, 9]
>           identifier [1, 4] - [1, 5]
>           integer [1, 8] - [1, 9]
>     consequence: block [2, 3] - [2, 7]
>       pass_statement [2, 3] - [2, 7]
> 
> 
> Version from the playground has correctly assigned fields:
> parenthesized_expression - condition:, block is labeled as
> consequence:, the second comparison_operator - right:
> 
> I noticed this regression after 9874561f39e62c1c9fada6c2e013f93d9ea65729.
> Quote from this commit "So turns out ts_node_field_name_for_child takes a named node index,"
> It seems that was a bug in the libtree-sitter and they fixed it in
> https://github.com/tree-sitter/tree-sitter/pull/2104
> Unfortunately, there is no release with this fix yet.
> 
> I have tested various combinations of libtree-sitter and fix from 9874561f39:
> With commit 9874561f39
> libtree-sitter v0.20.8 - condition: and consequence: fields are wrongly assigned
> libtree-sitter version with the fix* - most fields are broken
> 
> When reverting commit 9874561f39
> libtree-sitter v0.20.8 - only right: field is wrong (points to the comment node)
> libtree-sitter version with the fix* - ok

Yuan, any comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67990; Package emacs. (Sat, 30 Dec 2023 03:55:01 GMT) Full text and rfc822 format available.

Message #11 received at 67990 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Denis Zubarev <dvzubarev <at> yandex.ru>
Cc: 67990 <at> debbugs.gnu.org
Subject: Re: bug#67990: 30.0.50; tree-sitter:
 treesit-node-field-name-for-child seems to be broken after recent changes
Date: Fri, 29 Dec 2023 19:54:27 -0800

> On Dec 23, 2023, at 6:37 AM, Denis Zubarev <dvzubarev <at> yandex.ru> wrote:
> 
> 
> libtree-sitter is compiled from sources (latest version) 
> 
> Steps to reproduce:
> 1. emacs -Q
> 2. M-x find-file /tmp/t.py
> 3. Paste there
> if (v is not None and #comment
>    v > 0):
>   pass
> 4. M-x python-ts-mode
> 5. M-x treesit-explore-mode
>    python
> 
> Parse tree:
> (module
> (if_statement if
>  (parenthesized_expression (
>   (boolean_operator
>    left: (comparison_operator (identifier) operators: is not operators: is not operators: (none))
>    operator: and operator: (comment)
>    operator: (comparison_operator (identifier) operators: > operators: (integer)))
>   ))
>  condition: :
>  condition:
>   (block
>    (pass_statement pass))))
> 
> 
> Parse tree from the playground:
> module [0, 0] - [4, 0]
>  if_statement [0, 0] - [2, 7]
>    condition: parenthesized_expression [0, 3] - [1, 10]
>      boolean_operator [0, 4] - [1, 9]
>        left: comparison_operator [0, 4] - [0, 17]
>          identifier [0, 4] - [0, 5]
>          none [0, 13] - [0, 17]
>        comment [0, 22] - [0, 30]
>        right: comparison_operator [1, 4] - [1, 9]
>          identifier [1, 4] - [1, 5]
>          integer [1, 8] - [1, 9]
>    consequence: block [2, 3] - [2, 7]
>      pass_statement [2, 3] - [2, 7]
> 
> 
> Version from the playground has correctly assigned fields:
> parenthesized_expression - condition:, block is labeled as
> consequence:, the second comparison_operator - right:
> 
> I noticed this regression after 9874561f39e62c1c9fada6c2e013f93d9ea65729.
> Quote from this commit "So turns out ts_node_field_name_for_child takes a named node index,"
> It seems that was a bug in the libtree-sitter and they fixed it in
> https://github.com/tree-sitter/tree-sitter/pull/2104
> Unfortunately, there is no release with this fix yet.
> 
> I have tested various combinations of libtree-sitter and fix from 9874561f39:
> With commit 9874561f39
> libtree-sitter v0.20.8 - condition: and consequence: fields are wrongly assigned
> libtree-sitter version with the fix* - most fields are broken
> 
> When reverting commit 9874561f39
> libtree-sitter v0.20.8 - only right: field is wrong (points to the comment node)
> libtree-sitter version with the fix* - ok
> 
> 
> * tree-sitter version with the fix:
> git clone https://github.com/tree-sitter/tree-sitter.git
> git checkout 6d1904c221d15d2fcbe0b590ff0a3f96c692429f
> It is needed to recompile grammar after changing the libtree-sitter version.

Thank you very much! So it seems that we should revert that commit, and point to libtree-sitter if people come to us reporting errors. I reverted that commit on emacs-29.

Yuan



Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 30 Dec 2023 07:14:02 GMT) Full text and rfc822 format available.

Notification sent to Denis Zubarev <dvzubarev <at> yandex.ru>:
bug acknowledged by developer. (Sat, 30 Dec 2023 07:14:02 GMT) Full text and rfc822 format available.

Message #16 received at 67990-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 67990-done <at> debbugs.gnu.org, dvzubarev <at> yandex.ru
Subject: Re: bug#67990: 30.0.50;
 tree-sitter: treesit-node-field-name-for-child seems to be broken
 after recent changes
Date: Sat, 30 Dec 2023 09:12:56 +0200
> Cc: 67990 <at> debbugs.gnu.org
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Fri, 29 Dec 2023 19:54:27 -0800
> 
> 
> 
> > On Dec 23, 2023, at 6:37 AM, Denis Zubarev <dvzubarev <at> yandex.ru> wrote:
> > 
> > 
> > libtree-sitter is compiled from sources (latest version) 
> > 
> > Steps to reproduce:
> > 1. emacs -Q
> > 2. M-x find-file /tmp/t.py
> > 3. Paste there
> > if (v is not None and #comment
> >    v > 0):
> >   pass
> > 4. M-x python-ts-mode
> > 5. M-x treesit-explore-mode
> >    python
> > 
> > Parse tree:
> > (module
> > (if_statement if
> >  (parenthesized_expression (
> >   (boolean_operator
> >    left: (comparison_operator (identifier) operators: is not operators: is not operators: (none))
> >    operator: and operator: (comment)
> >    operator: (comparison_operator (identifier) operators: > operators: (integer)))
> >   ))
> >  condition: :
> >  condition:
> >   (block
> >    (pass_statement pass))))
> > 
> > 
> > Parse tree from the playground:
> > module [0, 0] - [4, 0]
> >  if_statement [0, 0] - [2, 7]
> >    condition: parenthesized_expression [0, 3] - [1, 10]
> >      boolean_operator [0, 4] - [1, 9]
> >        left: comparison_operator [0, 4] - [0, 17]
> >          identifier [0, 4] - [0, 5]
> >          none [0, 13] - [0, 17]
> >        comment [0, 22] - [0, 30]
> >        right: comparison_operator [1, 4] - [1, 9]
> >          identifier [1, 4] - [1, 5]
> >          integer [1, 8] - [1, 9]
> >    consequence: block [2, 3] - [2, 7]
> >      pass_statement [2, 3] - [2, 7]
> > 
> > 
> > Version from the playground has correctly assigned fields:
> > parenthesized_expression - condition:, block is labeled as
> > consequence:, the second comparison_operator - right:
> > 
> > I noticed this regression after 9874561f39e62c1c9fada6c2e013f93d9ea65729.
> > Quote from this commit "So turns out ts_node_field_name_for_child takes a named node index,"
> > It seems that was a bug in the libtree-sitter and they fixed it in
> > https://github.com/tree-sitter/tree-sitter/pull/2104
> > Unfortunately, there is no release with this fix yet.
> > 
> > I have tested various combinations of libtree-sitter and fix from 9874561f39:
> > With commit 9874561f39
> > libtree-sitter v0.20.8 - condition: and consequence: fields are wrongly assigned
> > libtree-sitter version with the fix* - most fields are broken
> > 
> > When reverting commit 9874561f39
> > libtree-sitter v0.20.8 - only right: field is wrong (points to the comment node)
> > libtree-sitter version with the fix* - ok
> > 
> > 
> > * tree-sitter version with the fix:
> > git clone https://github.com/tree-sitter/tree-sitter.git
> > git checkout 6d1904c221d15d2fcbe0b590ff0a3f96c692429f
> > It is needed to recompile grammar after changing the libtree-sitter version.
> 
> Thank you very much! So it seems that we should revert that commit, and point to libtree-sitter if people come to us reporting errors. I reverted that commit on emacs-29.

Thanks, I'm therefore closing this bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 27 Jan 2024 12:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 142 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.