-
Notifications
You must be signed in to change notification settings - Fork 323
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
Text blocks in Enso grammar for TextMate based editor #7539
Conversation
361e542
to
1d40989
Compare
tools/enso4igv/src/main/resources/org/enso/tools/enso4igv/enso.tmLanguage.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good and fast job, thanks! It is certainly much better than it used to be. Finally, all the tests that contains a lot of foreign
functions will be rendered (almost) correctly
Awesome! Would be cool to get the prefixes working, but it's already an improvement so I probably wouldn't wait on that. I don't have any ideas how to approach this - to do the I have one small request, can we also add this change? "name": "keyword.other",
- "match": "\\b(here|this|type)\\b"
+ "match": "\\b(here|self|type)\\b" We got rid of |
tools/enso4igv/src/main/resources/org/enso/tools/enso4igv/enso.tmLanguage.json
Outdated
Show resolved
Hide resolved
tools/enso4igv/src/main/resources/org/enso/tools/enso4igv/enso.tmLanguage.json
Outdated
Show resolved
Hide resolved
Right. The regexp is correct, but somebody needs to study the TextMate JSON to express that in spite whole line match only the Or somehow use regexp look behind assertions? |
i'm not sure lookbehinds are an option here unfortunately, since the leading indentation still needs to be captured |
I assume we should do this as a follow up PR then? |
Ops. Sorry. I thought I merged the change, but I must have forgotten. Subsequent improvements to official Enso grammar are always welcomed. |
Following up on #7539 which introduced great improvements to the Enso grammar, I add some more to try to make it even better. - Changing to highlight `self` instead of `this` (as the keyword was renamed a long time ago). - Trying to include the string quotes to be highlighted as part of the string - a bit more controversial but IMO it looks more consistent with simple literals. Before: ![image](https://github.com/enso-org/enso/assets/1436948/7d455c22-042a-4b43-a603-d661190aa7a4) After: ![image](https://github.com/enso-org/enso/assets/1436948/5bfab6c0-ad67-4302-b5d3-0ef2fce232a9)
Pull Request Description
New rules to recognize
"""
and'''
at the end of line and color everything that's inside nested block of text as string. It properly stops the string literal when nested block ends.Important Notes
The text mate grammar rules properly end the text block when the block ends. For example in:
a text
is properly recognized as string.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR: