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

Generate theme file #20

Merged
merged 10 commits into from
Oct 28, 2020
Merged

Generate theme file #20

merged 10 commits into from
Oct 28, 2020

Conversation

lunacookies
Copy link
Collaborator

@lunacookies lunacookies commented Oct 26, 2020

This PR implements a theme generator as I described in #19. Theoretically, generating a theme has quite a few advantages:

  • Formatting consistency
  • Ability to change colour palette at will
  • Removal of colour palette duplication
  • Removal of colour usage duplication (e.g. not repeating the colour used for properties in both TextMate and semantic highlighting)

I’ve only been able to exploit the first three of these at the moment, as I wanted to keep the generator as simple as possible to avoid spending too much time on it in case the PR is rejected. I also wanted to minimise the diff of the theme JSON file itself, which prevented me from making some changes. Instead, I think it’s better to make these changes after merging (if it gets merged) to show in the Git history that the theme wasn’t actually altered by the generator.

Todo if PR is merged

  • Add @generated comment to theme JSON (1464a87)
  • Format all scopes as arrays (at the moment scopes with only one element are outputted as the scope itself, rather than an array with one element) (31de6fd)
  • Use long format for all Styles (which lets us convert Style::as_json_value to a From implementation) (2f1b825)

@matklad
Copy link
Owner

matklad commented Oct 28, 2020

I haven't looked at this in details, but adding code genration seems good to me, 👍 !

@lunacookies
Copy link
Collaborator Author

Cool, do you think it’s worth merging as it is? Or would you prefer to look over it first?

@matklad
Copy link
Owner

matklad commented Oct 28, 2020 via email

@lunacookies lunacookies merged commit 2d1ef16 into matklad:master Oct 28, 2020
@lunacookies lunacookies deleted the generator branch October 28, 2020 12:05
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