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

No color for symbols #7

Closed
JayXon opened this issue Feb 28, 2019 · 3 comments
Closed

No color for symbols #7

JayXon opened this issue Feb 28, 2019 · 3 comments
Labels
theme-color More related to theme than it is the syntax wontfix This will not be worked on

Comments

@JayXon
Copy link

JayXon commented Feb 28, 2019

This extension
image

VSCode default
image

This is a minor issue, but +, * and & all lost its color when using this extension, ideally they should be highlighted with a different color than int.

@jeff-hykin jeff-hykin added the theme-color More related to theme than it is the syntax label Feb 28, 2019
@jeff-hykin
Copy link
Owner

jeff-hykin commented Feb 28, 2019

screen shot 2019-02-28 at 5 56 45 am

So I believe this is actually a setting with your theme.
BUT, the good news is VS Code lets you customize absolutely everything.
If you add the following code to your settings.json, it should make them the original color again.
And in fact, if you want, you can set them to whatever color you would like so it can be different than int. (Just change the "foreground": "#bc7ed7", part below to change the color)

        "editor.tokenColorCustomizations" : 
            {
                "textMateRules": [
                {
                    "name": "symbol color",
                    "scope": [
                        "source.cpp keyword.operator" // name of thing you want to color
                    ],
                    "settings": {
                        "foreground": "#bc7ed7", // color you want it to be
                        "fontStyle": "" // bold/underline/italics or none
                    }
                }
                ]
            },

The only thing this extension does is make sure that the language gets labeled correctly (e.g. strings are marked as 'strings' and operators are marked as 'keyword.operator'). It's then the theme's job to take those names and give them color.

If you think your theme should color it that way by default, post an issue on their repo and give them that code^ and they should know exactly what to change.

In my own settings I actually make the assignment operators different from the other operators, which is pretty handy when they accidentally end up inside of if statements.
screen shot 2019-02-28 at 5 55 13 am

@jeff-hykin
Copy link
Owner

jeff-hykin commented Feb 28, 2019

I'm going to keep this issue open for now until I can create a guide for customizing theme colors exactly how you want, because I believe this is going to be a common issue.

Not only can you change the colors but you can also change things like bold underline and cursive-ness of things. Read this if you want a little more info https://medium.com/@JeffHykin/how-to-get-cursive-fonts-in-vs-code-2018-without-operator-mono-220544fed93a

@jeff-hykin
Copy link
Owner

Alright, I finally created a simple post for this, feel free to read it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme-color More related to theme than it is the syntax wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants