-
Notifications
You must be signed in to change notification settings - Fork 21
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
Grammar Improvements #18
Conversation
Before this change TextMate would use the wrong scope (`keyword.other.double-colon.haskell`) for the second equal sign in the following Haskell code: ```hs instance Eq Time where -- ↓ Wrong scope `keyword.other.double-colon.haskell` (==) :: Time -> Time -> Bool ``` .
Before this change TextMate would incorrectly highlight parts of function signatures that continue over multiple lines. For example the third `Integer` in the following code: ```hs add :: Integer -> Integer -> Integer -- ← Wrong scope `constant.other.haskell` ``` would use the scope `constant.other.haskell` instead of the correct `support.type.prelude.haskell`.
I copied your changes here verbatim into JustusAdam/language-haskell@b195289 and there arises the issue that function names are not recognized as such anymore. Can you explain why that is? The markup generally works (for multiline type signatures too) but the function names are not marked as functions anymore |
Hi Justus, thank you for your feedback.
I assume you refer to the name of the function in the function signature? E.g. add :: Integer -> Integer ->
Integer or the first |
Thank you for adding the screenshots. It looks like the cause of this behaviour could be a bug in the parsing code of Visual Studio Code (VSC). If I change the . If I change the . In my opinion the , I think it is best you open an issue at the bug tracker of Visual Studio Code and ask them why VSC behaves differently. |
Thanks a bunch. I'll open an issue there. Is there any other way we can phrase the pattern to make it work? Because the alternate pattern breaks all the other markup. |
Actually, I have a suggestion that seems to fix it: I changed the
What do you think? will that work? |
I can not think of an easy way to fix this. In my opinion the pattern • A Description of Regular Expressions and Regex Engines .
Yeah, I know. If the simpler pattern would work I would have used it myself 😊. |
I just tried it out, and I don't think you need the complex pattern anyways.
I just compiled a file with this type signature in it and it worked fine. It seems the continued type signature doesn't have to be indented as far as the first, or preceding line, so long as it is indented at all. |
Never mind I see the issue. I was looking at the wrong indentation. |
Yeah, I ran into that immediately. But I have good news, it seems the issue is the
|
I do not think so, how would you distinguish between
if there are no additional signs (e.g. setSession ? |
Yeah I guess so. Thats the problem with parsers that only look at one line at a time. You'd probably need some general rule for indented blocks of lines and then distinguish different cases (expression, signature, definition, etc) for the entire block |
Pulled in, thanks @sanssecours! |
Hi,
this pull request includes two fixes for the bundle grammar. The screenshot below shows the effect of the changes using the Rainbow Dash theme:
Hope the grammar updates are helpful. If I should change anything, then please just comment below.
Kind regards,
René