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 coloring of Types with '-' in their name. #245

Merged
merged 2 commits into from
Feb 18, 2024

Conversation

floitsch
Copy link
Member

Types like X-Of weren't highlighted as type.

Types like `X-Of` weren't highlighted as type.
@floitsch floitsch requested a review from kasperl February 17, 2024 10:40
Copy link
Contributor

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Looks good to me.

- name: entity.name.type.toit
match: \b(?<!-)_?[A-Z][A-Z_-]*[a-z][\w-]*(?<!-)\b[?]?
- name: entity.name.type.toit
match: \b(?<!-)_?[A-Z][0-9]*(?<!-)\b[?]?
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have special handling for prefix underscores here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why we have it. (Maybe still old privacy syntax).
That said, I think I would expect _A to be a type.
In the end it's just an heuristic.

That said: it doesn't cover the A_ case, which should also be a type.
Added that.
done.

@floitsch floitsch merged commit 6e23f81 into master Feb 18, 2024
1 check passed
@floitsch floitsch deleted the floitsch/more-syntax-fixes branch February 18, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants