all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#73376: Treesitter does not rescan after indentation
@ 2024-09-20  7:00 pranshu sharma
  2024-09-21  4:20 ` Yuan Fu
  0 siblings, 1 reply; 4+ messages in thread
From: pranshu sharma @ 2024-09-20  7:00 UTC (permalink / raw)
  To: 73376


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.





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

* bug#73376: Treesitter does not rescan after indentation
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Yuan Fu @ 2024-09-21  4:20 UTC (permalink / raw)
  To: pranshu sharma; +Cc: 73376



> 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




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

* bug#73376: Treesitter does not rescan after indentation
  2024-09-21  4:20 ` Yuan Fu
@ 2024-09-22  6:35   ` Yuan Fu
  2024-09-23 13:08     ` pranshu sharma
  0 siblings, 1 reply; 4+ messages in thread
From: Yuan Fu @ 2024-09-22  6:35 UTC (permalink / raw)
  To: pranshu sharma; +Cc: 73376



> 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




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

* bug#73376: Treesitter does not rescan after indentation
  2024-09-22  6:35   ` Yuan Fu
@ 2024-09-23 13:08     ` pranshu sharma
  0 siblings, 0 replies; 4+ messages in thread
From: pranshu sharma @ 2024-09-23 13:08 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 73376


Ok, keep us updated if any progress is made





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

end of thread, other threads:[~2024-09-23 13:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-09-23 13:08     ` pranshu sharma

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.