GNU bug report logs - #59415
29.0.50; [feature/tree-sitter] c-ts-mode fails to fontify a portion of a large C file

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sun, 20 Nov 2022 17:56:02 UTC

Severity: normal

Found in version 29.0.50

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

Bug is archived. No further changes may be made.

Full log


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

From: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>, bug-gnu-emacs <at> gnu.org
Cc: Yuan Fu <casouri <at> gmail.com>
Subject: Re: 29.0.50; [feature/tree-sitter] c-ts-mode fails to fontify a
 portion of a large C file
Date: Sun, 20 Nov 2022 21:17:20 +0100
>
> P.S. Btw, isn't the treesit-max-buffer-size limit too low?  4 MiB?

I thought it was supposed to be 4 gigs, as seen in this function:

```
static void
treesit_check_buffer_size (struct buffer *buffer)
{
  ptrdiff_t buffer_size = (BUF_Z (buffer) - BUF_BEG (buffer));
  if (buffer_size > UINT32_MAX)
    xsignal2 (Qtreesit_buffer_too_large,
	      build_pure_c_string ("Buffer size cannot be larger than 4GB"),
	      make_fixnum (buffer_size));
}
```

So my guess is that that is a typo, and should be


(defcustom treesit-max-buffer-size (* 4 1024 1024 1024)
  "Maximum buffer size for enabling tree-sitter parsing (in bytes)."
  :type 'integer
  :version "29.1")

or something like that :-)

Theo




This bug report was last modified 2 years and 183 days ago.

Previous Next


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