-
Notifications
You must be signed in to change notification settings - Fork 0
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
Basic multiline highlighting #13
Conversation
…h the latest version of the semantic tokenizer
… for synthetic names)
…nd inner/outer rules Note: This changes the nature of conversion units from types to only read from, to types to also write to.
… multi-line productions
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.
A few additional clarifying comments
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.
That's a lot of work again! I like the readability of the code and the usage of a lot of utility functions. To me, this helps a lot with readability.
Good choice to split out some of the logic to separate modules.
The tests are hard to review for me, but at least look like they cover a lit of cases.
rascal-textmate-core/src/main/rascal/lang/rascal/grammar/Util.rsc
Outdated
Show resolved
Hide resolved
rascal-textmate-core/src/main/rascal/lang/textmate/Conversion.rsc
Outdated
Show resolved
Hide resolved
rascal-textmate-core/src/main/rascal/lang/textmate/Conversion.rsc
Outdated
Show resolved
Hide resolved
"name": "constant.regexp" | ||
}, | ||
"2": { | ||
"name": "" |
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.
@sungshik is this a bug?
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.
Nope, but it's not particularly elegant either 😉 Some generated regexes have groups that are used only internally for matching, without a category. These show up here as empty strings. This has no impact on the highlighting, but I agree it would be nicer to not have these degenerate entries in the captures
map at all. It requires the addition of just a simple non-emptiness check. I've fixed that now.
Thank you, Toine, Davy, and Pieter for the comments 🙂 |
This PR adds basic support for multiline highlighting:
ConversionUnit
for more details in the comments.All tests are updated accordingly as well (and some new ones were added).