-
Notifications
You must be signed in to change notification settings - Fork 48
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
Incorrect highlighting for multi-line signatures. #60
Comments
I found a solution that seems to work following lspitzner/brittany#94. Therefore, I think the issue can be closed. |
Yeah, this is a known issue. Due to how the grammar files work parsing Haskell correctly is rather difficult. I am still unsure whether it is at all possible to write a grammar for this but unfortunately I don't have the time to investigate it currently. |
Hello @JustusAdam , I think the issue there comes from not parameterizing correctly Brittany (my fault). Best, Pascal |
Well, its not really your fault though. My personal beliefe is that the syntax highlighter should be able to correctly highlight anything that the compiler also accepts. |
I wonder then why didn't the atom highlighting have this bug since it also uses texmate syntax? |
It's not possible to highlight the function name as we would need to be able to look ahead on subsequent lines to see if we can find a double colon, which isn't possible with TextMate grammars. However it is possible to highlight the type signature, after the double colon (implemented in 3695e33). So it'll just be the function definition that won't have the expected highlighting. Note that Atom TextMate highlighting (as used on GitHub) suffers from the same limitation: foo :: A -> B
foo
:: A
-> B |
Thank you. |
So because I've just, again, spent 15 minutes trying to figure out if it is possible I want to put down my reasoning here so next time I inevitably see this issue again I can just read why its impossible.
In conclusion: It is possible to match declarations/definitions but by the time we disambiguate we can't refer to the identifier anymore to give it the correct textmate scope. |
Hello,
First of all, thanks a lot for all your work on the plugin.
I have an issue with multi-line signatures (as formatted by Brittany).
The rendering of types in lines 2..n of the signature is not consistent with line 1 (it looks like constructors rather than types).
See, eg,
vs (expected)
This could possibly be linked to #1.
Nb: I have seen also #27.
I am using:
The text was updated successfully, but these errors were encountered: