tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
155 stars 36 forks source link

Grammar defines trailing whitespace as part of lambda case statement #74

Closed wenkokke closed 5 months ago

wenkokke commented 2 years ago

The exp_lambda_case node associated with the first definition includes the trailing white space:

Screenshot 2022-03-07 at 15 47 50

This results, for example, in incorrect deletions when operating based off the AST, with a deletion of the lambda case expression resulting in:

Screenshot 2022-03-07 at 15 50 06

tek commented 2 years ago

huh. are you positive this doesn't happen with any other nodes? I remember fixing this problem for comments, I thought I scrutinized every single whitespace parser for similar behaviour at that time. Could this be a regression from the scanner's translation to C? In any case, I'll investigate.

btw, what's the deal with those ornaments on top of every token? :upside_down_face:

wenkokke commented 2 years ago

It might be happening with other notes that I haven’t discovered yet.

wenkokke commented 2 years ago

btw, what's the deal with those ornaments on top of every token? 🙃

https://marketplace.visualstudio.com/items?itemName=pokey.cursorless

it’s why I’m reliant on this grammar, for voice coding

tek commented 2 years ago

wow, never seen anything like that before. interesting