all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: pranshu sharma <pranshusharma366@gmail.com>
Cc: 73376@debbugs.gnu.org
Subject: bug#73376: Treesitter does not rescan after indentation
Date: Sat, 21 Sep 2024 23:35:50 -0700	[thread overview]
Message-ID: <14EDC741-DDDC-45D1-B76E-7BA240373176@gmail.com> (raw)
In-Reply-To: <8AD9587C-1C21-41A0-93EF-84B227C24A72@gmail.com>



> On Sep 20, 2024, at 9:20 PM, Yuan Fu <casouri@gmail.com> wrote:
> 
> 
> 
>> On Sep 20, 2024, at 12:00 AM, pranshu sharma <pranshusharma366@gmail.com> wrote:
>> 
>> 
>> 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.
>> 
> 
> Hi Pranshu,
> 
> Thanks for the report. I can reproduce it. Let me see what’s going on here.
> 
> Yuan

Seems to be a tree-sitter or tree-sitter-haskell bug, reported here: https://github.com/tree-sitter/tree-sitter-haskell/issues/129

Yuan




  reply	other threads:[~2024-09-22  6:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20  7:00 bug#73376: Treesitter does not rescan after indentation pranshu sharma
2024-09-21  4:20 ` Yuan Fu
2024-09-22  6:35   ` Yuan Fu [this message]
2024-09-23 13:08     ` pranshu sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14EDC741-DDDC-45D1-B76E-7BA240373176@gmail.com \
    --to=casouri@gmail.com \
    --cc=73376@debbugs.gnu.org \
    --cc=pranshusharma366@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.