Skip to content

Conversation

@sethmaclean
Copy link
Collaborator

This PR adds the keyword modifier class for syntax highlighting when the "optional" keyword is used in interface declarations.

Note: There may very well be a separate class that we would like to store this value in instead. if so please LMK and I will make the necessary adjustments.

Before:
image

After:
image

@sethmaclean sethmaclean self-assigned this Mar 5, 2025
@sethmaclean sethmaclean changed the base branch from master to bug-fix-syntax-highlighting-return-statements March 5, 2025 16:21
Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few suggestions. Also, can you add some unit tests to verify the colorization works in interface declarations, and also that we are not capturing optional as blue in other situations (like function names, parameters, and variables).

},
"interface_field": {
"begin": "(?i)\\s*\\b([a-z0-9_]+)(?:[\\s\\t]*(as))?",
"begin": "(?i)\\s*\\b([a-z0-9_]+)(?:[\\s\\t]*(as))",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might want to add optional in this regex as an additional optional capture group rather than capturing it as its unique named item.

@sethmaclean
Copy link
Collaborator Author

still not working quite right, the following fields are not styling properly due to overlapping issues with the function logic in entire_language
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants