Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Vscode """ """ string when comment color somehow got turned to dark green

example

One day, the color """ """ string when comment color somehow got turned to dark green.
While the string color remain light orange.
I had try to change comments’ color in settings, but it only effect the # comment.

"editor.fontLigatures": false,
"workbench.colorTheme": "Default Dark+",

"editor.tokenColorCustomizations":{
    "comments":"#a1b876",
}

how do I change the color of """ """ string when comment to custom color or at least normal string color?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

""" is not a comment, it’s still a string.

As for why the two triple-quote strings in the picture have different colors, because hhh is recognized as a docstring.

enter image description here

You can change the color with the following settings

    "editor.tokenColorCustomizations": {
        "[Default Dark+]": {
            "textMateRules": [
                {
                    "name": "docstring",
                    "scope": "string.quoted.docstring.multi.python",
                    "settings": {
                        "foreground": "#FF0000"
                    }
                },
                {
                    "name": "string",
                    "scope": "string.quoted.multi.python",
                    "settings": {
                        "foreground": "#0de711"
                    }
                }
            ]
        }
    }

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading