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

Typeclasses with exactly one declaration don't highlight properly #91

Closed
Jeremy-Stafford opened this issue May 28, 2019 · 3 comments
Closed

Comments

@Jeremy-Stafford
Copy link

Type-class definitions with exactly one declaration 'take over' the remainder of the file:
image
This does not happen if there is (literally) anything on the next line:
image
It also does not happen for type-classes with no declarations:
image

@JustusAdam JustusAdam added the bug label May 29, 2019
@JustusAdam
Copy link
Owner

Weird, I cannot reproduce that behaviour.

When I tried it it worked. Both with an empty line, and even if there was not space in between at all.

Captura de pantalla 2019-06-05 a las 12 08 25 a  m

Captura de pantalla 2019-06-05 a las 12 08 17 a  m

@Jeremy-Stafford
Copy link
Author

After a bit of testing, I have discovered that it works so long as the module block is not indented, as is quite a common style. However, if it is indented, then it does not work. This is also true for GADTs:
image

image

This is probably because most people do not indent module blocks, so this should probably become a feature rather than a bug (eg, 'add support for indented module blocks').

@JustusAdam
Copy link
Owner

Turns out this was actually a bug in the matcher for when a type annotation ends and thus a more general problem

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

No branches or pull requests

2 participants