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

editor.tokenColorCustomizations not applying font style #42939

Closed
ghost opened this issue Feb 4, 2018 · 8 comments
Closed

editor.tokenColorCustomizations not applying font style #42939

ghost opened this issue Feb 4, 2018 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug themes Color theme issues verified Verification succeeded
Milestone

Comments

@ghost
Copy link

ghost commented Feb 4, 2018

  • VSCode Version: Code 1.19.3 (7c4205b, 2018-01-25T10:25:01.248Z)
  • OS Version: Darwin x64 17.4.0
  • Extensions:
Extension Author (truncated) Version
vsc-material-theme Equ 1.3.0
vscode-intelephense-client bme 0.8.5
phpunit ema 2.1.1
php-debug fel 1.12.1
composer ika 0.7.1
vs-code-phpunit-snippets jam 0.0.2
php-docblocker nei 1.3.3
java red 0.18.1
open-in-browser tec 1.1.0
vscode-java-debug vsc 0.6.0
vscode-java-pack vsc 0.2.0

(5 theme extensions excluded)


I am not seeing the fontStyle changes I am trying to apply. The Theme I use (Nord Extra Dark) has applied italics in some places, and I am trying to set them to normal instead. I have removed the "fontStyle": "italic" from each of the following yet there is no change in the editor.

Is there a way to do this that will override a theme's choices? It seems simply not setting it is allowing the theme to rule in the case of fontStyle.

Steps to Reproduce:

  1. Add the following to the settings:
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": [
                    "variable.language.php"
                ],
                "settings": {
                    "foreground": "#bf616a",
                }
            },
            {
                "scope": [
                    "variable.language.this.php"
                ],
                "settings": {
                    "foreground": "#bf616a",
                }
            },
            {
                "scope": [
                    "variable.language.this.php"
                ],
                "settings": {
                    "foreground": "#bf616a",
                }
            }
        ]
    },
  1. Save and close -> open VS Code, as looking at it on-the-fly has no change. Still no change in this case either.
@vscodebot vscodebot bot added the themes Color theme issues label Feb 4, 2018
@usernamehw
Copy link
Contributor

Can you try to set "fontStyle": ""?

@ghost
Copy link
Author

ghost commented Feb 4, 2018

You know, I just found that out as you typed the comment. Thank you!

I feel this whole area is lacking in documentation, as the hint if you type an incorrect value doesn't mention leaving it empty to override it.

@usernamehw
Copy link
Contributor

Seems logical to me to override only specified properties.

Validation probably disabled because values can be compound: "bold underline", "italic underline bold"...

Some documentation is there:
https://code.visualstudio.com/docs/extensions/themes-snippets-colorizers#_textmate-theme-rules
https://code.visualstudio.com/blogs/2017/02/08/syntax-highlighting-optimizations#_textmate-themes

@usernamehw
Copy link
Contributor

Probably can be validated against list:

""
"bold"
"underline"
"italic"
"bold italic"
"italic bold"
"bold underline"
"underline bold"
"italic underline"
"underline italic"
"bold italic underline"
"italic bold underline"
"underline bold italic"
"bold underline italic"
"italic underline bold"
"underline italic bold"

@alexdima
Copy link
Member

alexdima commented Feb 5, 2018

fontStyle is an optional property. So it is valid to skip it. Skipping it means that you do not wish to overwrite the font style (i.e. you go with the settings defined in the theme). The same applies for foreground, it is optional. Skipping it means that you do not wish to overwrite the color.

@aeschli For the schema considerations.

@aeschli
Copy link
Contributor

aeschli commented Feb 5, 2018

I will update the description for the property to mention the empty string.
Note that we already document and validate all valid values:
image

@aeschli aeschli added this to the February 2018 milestone Feb 5, 2018
@aeschli aeschli added the bug Issue identified by VS Code Team member as probable bug label Feb 5, 2018
@ghost
Copy link
Author

ghost commented Feb 6, 2018

Thanks all.

@aeschli aeschli closed this as completed in 239c2d1 Feb 7, 2018
@octref octref added the verified Verification succeeded label Mar 1, 2018
@formspoint
Copy link

Why can't we change the fontFamily here? For example, I'd like to change the comparison operator to font Fira Code in order to turn on Ligatures just in this spot.

  "editor.tokenColorCustomizations": {
        "[Dark++ Italic]": {
            "textMateRules": [
                {
                    "name": "LigsArrow",
                    "scope": [
                        "keyword.operator.comparison",
                        "meta.block",
                        "meta.arrow",
                        "meta.var.expr",
                        "source"
                    ],
                    "settings": {
                        "foreground": "#FF0000",
                        "fontFamily": "Fira Code"
                    }
                },

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug themes Color theme issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants