GNU bug report logs - #71863
31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges

Previous Next

Package: emacs;

Reported by: Noah Peart <noah.v.peart <at> gmail.com>

Date: Sun, 30 Jun 2024 20:13:01 UTC

Severity: normal

Found in version 31.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: noah.v.peart <at> gmail.com, 71863 <at> debbugs.gnu.org
Subject: Re: bug#71863: 31.0.50; Wrong argument type for treesit-query-range
 in treesit-update-ranges
Date: Sun, 07 Jul 2024 08:35:21 +0300
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Sat, 6 Jul 2024 13:50:10 -0700
> Cc: Noah Peart <noah.v.peart <at> gmail.com>,
>  71863 <at> debbugs.gnu.org
> 
> 
> 
> > On Jul 6, 2024, at 1:38 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > 
> >> From: Noah Peart <noah.v.peart <at> gmail.com>
> >> Date: Sun, 30 Jun 2024 16:12:06 -0400
> >> 
> >> I just noticed this after building latest Emacs. In
> >> `treesit-update-ranges`, during redisplay, the first argument to
> >> `treesit-query-range` is a tree-sitter language symbol, not a node.
> >> 
> >> At treesit.el:760
> >> 
> >>    (let* ((host-lang (treesit-query-language query))
> >>           (parser (treesit-parser-create language))
> >>           (old-ranges (treesit-parser-included-ranges parser))
> >>>>> host-lang isnt a node
> >>           (new-ranges (treesit-query-range
> >>                        host-lang query beg end offset))
> >> 
> >> This causes a an error in modes that have set `treesit-range-settings`
> >> eg., `js-ts-mode`:
> >> 
> >>> Error muted by safe_call: (treesit--font-lock-mark-ranges-to-fontify
> >>> ((1 . 940)) #<treesit-parser for javascript>) signaled
> >>> (wrong-type-argument treesit-node-p javascript) Error during
> >>> redisplay: (jit-lock-function 1) signaled (wrong-type-argument
> >>> treesit-node-p javascript)
> >> 
> >> And in `syntax-propertize-function`, for example in `ruby-ts-mode`,
> >> 
> >>> QuitError muted by safe_call: (internal--syntax-propertize 46)
> >>> signaled (wrong-type-argument treesit-node-p ruby) 
> > 
> > Yuan, could you please look into this issue?
> 
> This is a bug I introduced on emacs-30 and later fixed. So once emacs-30 is merged into master the issue should go away. Sorry for the trouble :-(

When did you fix it on emacs-30?  The merges to master happen very
frequently lately; the last one was yesterday.  Could it be that this
is already fixed?




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

Previous Next


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