Shopify / vscode-shopify-ruby

An opinionated and auto-configured set of extensions for Ruby development
MIT License
176 stars 13 forks source link

Add diff syntax highlight #423

Closed louim closed 1 year ago

louim commented 1 year ago

Hello! Here is a screenshot what a diff looks like in the Solarized Dark theme Screenshot 2023-04-20 at 2 07 15 PM Here is the same diff in the Spinel theme Screenshot 2023-04-20 at 2 07 19 PM

I added the required tokens to make it work with Spinel, based on the Solarized dark colors.

Result: image

I'd be happy to adjust the colors to something more appropriate for the theme, if someone want to suggest what should be used.

louim commented 1 year ago

I have signed the CLA!

vinistock commented 1 year ago

Thank you very much for the contribution! Are these tokens only used when viewing git patches or do they also apply to solving conflicts?

Also, instead of using colours from a different theme, we should try to stick to the colours used in Spinel. We have red, green and blue for keywords, strings and local variables, respectively. Can we use those instead?

vinistock commented 1 year ago

Oh, I think you need to format the file. Running yarn run format should do the trick.

louim commented 1 year ago

@vinistock thanks! I updated the colors to use theme colors. Here's an example showcasing the changed color when used with git commit --verbose. Screenshot 2023-04-25 at 5 29 53 PM

Are these tokens only used when viewing git patches or do they also apply to solving conflicts?

I think that VSCode uses special colors to highlight the in app merge and diffs. They do not seem affected by the theme itself.

I also had to remove the punctuation from tokenColors for the punctuation highlight to work correctly.

Before removing punctuation:

Screenshot 2023-04-26 at 10 18 30 AM

After removing punctuation:

Screenshot 2023-04-26 at 10 18 03 AM

Maybe we would then need to define more specific punctuation scopes?