Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangs when highlighting/parsing data Aa = Bb | Cc | #119

Open
amadeusdotpng opened this issue Mar 21, 2024 · 3 comments
Open

Hangs when highlighting/parsing data Aa = Bb | Cc | #119

amadeusdotpng opened this issue Mar 21, 2024 · 3 comments

Comments

@amadeusdotpng
Copy link

Running

tree-sitter highlight a.hs
# or
tree-sitter parse a.hs

with a.hs as

-- Fails
data Aa = Bb | Cc | 

Works just fine if a.hs is any of the following

-- Works
data Aa = Bb | 
-- Works
data Aa = Bb | Cc | Dd 
-- Works
data Aa = Bb | Cc | 

f :: int -> int

Using Mac M1 Pro, MacOS Monterey 12.5.1

@tek
Copy link
Contributor

tek commented Mar 21, 2024

thanks! appears to be fixed in the rewrite, check out this repo for a preview

@vyuuui
Copy link

vyuuui commented Apr 7, 2024

Second this, also hangs after a typeclass constraint for a data declaration (seems to be after the => token is seen?), but only if it's not the first thing parsed in the file.
Minimal example:

a = 0
g :: (Eq a) =>

@lex-LKNeu
Copy link

Second this, also hangs after a typeclass constraint for a data declaration (seems to be after the => token is seen?), but only if it's not the first thing parsed in the file. Minimal example:

a = 0
g :: (Eq a) =>

I'm having the exact same problem, but it only appears to occur if the unfinished constraint is the very last thing in the file.

bar = 3

foo :: (Num a) =>

That hangs, but if, before I type the constraint, I put something else to parse after it (I tested with the character f on the next line), it's fine:

bar = 3

foo :: (Num a) => a -> a -- I could type this just fine
f -- if I put this here first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants