all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#71863: 31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges
@ 2024-06-30 20:12 Noah Peart
  2024-06-30 20:37 ` Noah Peart
  2024-07-06  8:38 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Noah Peart @ 2024-06-30 20:12 UTC (permalink / raw)
  To: 71863

[-- Attachment #1: Type: text/plain, Size: 4585 bytes --]

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)



In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.33, cairo version 1.16.0) of 2024-06-30 built on nverno-XPS-8940
Repository revision: 7c8d4e96ba6db19bdca20a87bafed024a84eb517
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.4 LTS

Configured using:
 'configure --prefix=/usr/local --with-modules --with-tree-sitter
 --with-threads --with-x-toolkit=gtk3 --with-xwidgets --with-gnutls
 --with-json --with-mailutils --with-jpeg --with-png --with-rsvg
 --with-tiff --with-xml2 --with-xpm --with-imagemagick CC=gcc-12
 CXX=gcc-12'

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

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: JavaScript

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-seq
typescript-ts-mode js c-ts-common json subr-x map byte-opt gv bytecomp
byte-compile imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs treesit cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode 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 xwidget-internal 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 104084 13132) (symbols 48 8580 0) (strings 32 24764 2578)
 (string-bytes 1 884578) (vectors 16 14855)
 (vector-slots 8 188214 9981) (floats 8 28 203) (intervals 56 852 0)
 (buffers 992 12))

[-- Attachment #2: Type: text/html, Size: 5076 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#71863: 31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges
  2024-06-30 20:12 bug#71863: 31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges Noah Peart
@ 2024-06-30 20:37 ` Noah Peart
  2024-07-06  8:38 ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Noah Peart @ 2024-06-30 20:37 UTC (permalink / raw)
  To: 71863

[-- Attachment #1: Type: text/plain, Size: 101 bytes --]

This is related to the new node check from commit 8819e5a45d5, not
the functions I mentioned before!

[-- Attachment #2: Type: text/html, Size: 847 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#71863: 31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges
  2024-06-30 20:12 bug#71863: 31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges Noah Peart
  2024-06-30 20:37 ` Noah Peart
@ 2024-07-06  8:38 ` Eli Zaretskii
  2024-07-06 20:50   ` Yuan Fu
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-07-06  8:38 UTC (permalink / raw)
  To: Noah Peart, Yuan Fu; +Cc: 71863

> From: Noah Peart <noah.v.peart@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?





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#71863: 31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges
  2024-07-06  8:38 ` Eli Zaretskii
@ 2024-07-06 20:50   ` Yuan Fu
  2024-07-07  5:35     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Yuan Fu @ 2024-07-06 20:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Noah Peart, 71863



> On Jul 6, 2024, at 1:38 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Noah Peart <noah.v.peart@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 :-(

Yuan






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#71863: 31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges
  2024-07-06 20:50   ` Yuan Fu
@ 2024-07-07  5:35     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2024-07-07  5:35 UTC (permalink / raw)
  To: Yuan Fu; +Cc: noah.v.peart, 71863

> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 6 Jul 2024 13:50:10 -0700
> Cc: Noah Peart <noah.v.peart@gmail.com>,
>  71863@debbugs.gnu.org
> 
> 
> 
> > On Jul 6, 2024, at 1:38 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> > 
> >> From: Noah Peart <noah.v.peart@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?





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-07  5:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-30 20:12 bug#71863: 31.0.50; Wrong argument type for treesit-query-range in treesit-update-ranges Noah Peart
2024-06-30 20:37 ` Noah Peart
2024-07-06  8:38 ` Eli Zaretskii
2024-07-06 20:50   ` Yuan Fu
2024-07-07  5:35     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.