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

Fix inline for-expression matching #117

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Fix inline for-expression matching #117

merged 2 commits into from
Apr 3, 2024

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Mar 28, 2024

This PR improves the inline-for regex, which used to break the highlighting of the rest of the file because it was never terminated.

In the old structure, the end: \n regex never matched the end of the line in the example, because the object repository would consume the { at the end of the line (including the newline). By changing this to a single match regex, we can now match the entire line and then delegate the second capture expression to the for_expression_body as before.

This shouldn't affect any of our existing tests related to for-expressions.

UX Before

CleanShot 2024-03-28 at 17 15 16@2x

UX After

CleanShot 2024-03-28 at 17 14 46@2x

Closes #113

@dbanck dbanck added the bug Something isn't working label Mar 28, 2024
@dbanck dbanck requested a review from a team as a code owner March 28, 2024 16:22
@ansgarm ansgarm merged commit 0b8c010 into main Apr 3, 2024
5 checks passed
@ansgarm ansgarm deleted the b-improve-inline-for branch April 3, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mis-highlighting after for expression
3 participants