Binaryify / OneDark-Pro

Atom's iconic One Dark theme for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=zhuangtongfa.Material-theme
MIT License
1.52k stars 289 forks source link

Inconsistency for Ruby 1.9 symbol #268

Closed foreverqihe closed 5 years ago

foreverqihe commented 6 years ago

Thank you for solving the ruby color for symbol. It would be great if you can do one more change for an alternative symbol syntax for Ruby 1.9+

:one => 1 # normal form

one: 1 # ruby 1.9+

So it is still inconsistent. And even the function args look different as well:) Atom:image

One Dark Pro: image

Originally posted by @foreverqihe in https://github.com/Binaryify/OneDark-Pro/issues/258#issuecomment-427642264

chpxu commented 5 years ago

I cannot repro this as per this screenshot (I have no idea how to Ruby), image

What version of VSCode and One Dark Pro are you using?

foreverqihe commented 5 years ago

I cannot repro this as per this screenshot (I have no idea how to Ruby), image

What version of VSCode and One Dark Pro are you using?

I am using vs code 1.28.2 and Ruby plugin 0.20.0. One Dark Pro 2.17.4

Maybe you didn't install the plugin but it is necessary for a Ruby developer. To replicate, create a file ends with ".rb", e..g test.rb and paste the code into it. Open it with vs code.

chpxu commented 5 years ago

Alright I get it now. Thanks for the help.

When installing the Ruby extension on VSCode, it creates additional scopes that native VSCode does not have. Of these scopes which are relevant to your issue, are: variable and constant. Since One Dark Pro only really supports the languages' prebuilt scopes (and Ruby never provided them in the first place), the default highlighting for these scopes will just come into effect. As such the default variable is that red colour and the default constant is that yellowish-orange.

Now I haven't investigated Atom completely, but it seems the Ruby language doesn't define those variable and constant scopes like VSCode, hence it uses that highlighting shown in your first screenshot. You might then suggest to incorporate this change but that'd be up to @Binaryify as it is extension-related rather than prebuilt. You could always fork and open a pull request, or I could... Either is fine, but he has the final say :>

Hope this helps!

chpxu commented 5 years ago

You could also just define them in your settings.json too...

foreverqihe commented 5 years ago

You could also just define them in your settings.json too...

Thank you for the investigation. Would you mind letting me know how to do it in the settings.json, if it doesn't take too much time for you?