GNU bug report logs -
#71863
31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges
Previous Next
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
View this message in rfc822 format
> 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 bug report was last modified 306 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.