GNU bug report logs - #73376
Treesitter does not rescan after indentation

Previous Next

Package: emacs;

Reported by: pranshu sharma <pranshusharma366 <at> gmail.com>

Date: Fri, 20 Sep 2024 07:02:01 UTC

Severity: normal

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

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Yuan Fu <casouri <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#73376: closed (Treesitter does not rescan after indentation)
Date: Mon, 26 May 2025 22:48:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 26 May 2025 15:47:08 -0700
with message-id <F7CDF3B3-6E8F-4122-B3C8-79156A02159E <at> gmail.com>
and subject line Re: bug#73376: Treesitter does not rescan after indentation
has caused the debbugs.gnu.org bug report #73376,
regarding Treesitter does not rescan after indentation
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
73376: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73376
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: pranshu sharma <pranshusharma366 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Treesitter does not rescan after indentation
Date: Fri, 20 Sep 2024 17:00:39 +1000
After indenting, treesitter does not rescan the region.  This causes
errors in the concrete syntax tree, which mess up indentation and syntax
colouring.

The issue I'm having is kind of hard to explain, but in a summary I have
the poorly indented code, where what's between '_'(which is not in the
code itself) is coloured:
---------------
f x =
               let _a_ = 2
                   _c_ = 1
  in a
--------------
Then when I indent it with haskell-ts-mode, I get:
---------------
f x =
  let _a_ = 2
      c = 1
  in a
--------------
When the 2 snippets of code have the exact same meaning.  If I revert
the buffer then the 'c' becomes coloured again.

This is not just problem with syntax highlighting, but if I was to
indent the 2nd snippet it would mess it up, as it has the wrong CST.


[Message part 3 (message/rfc822, inline)]
From: Yuan Fu <casouri <at> gmail.com>
To: Pranshu <pranshusharma366 <at> gmail.com>
Cc: 73376-done <at> debbugs.gnu.org
Subject: Re: bug#73376: Treesitter does not rescan after indentation
Date: Mon, 26 May 2025 15:47:08 -0700

> On May 25, 2025, at 10:57 PM, Pranshu <pranshusharma366 <at> gmail.com> wrote:
> 
> It's fixed now, thanks!

Great! Closing.

Yuan

This bug report was last modified 27 days ago.

Previous Next


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