“Vscode” """ """ 当注释颜色不知何故变成了深绿色时

huangapple go评论73阅读模式
英文:

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

问题

example

有一天,当注释颜色不知何故变成深绿色时,字符串颜色保持为浅橙色。
我尝试在设置中更改注释的颜色,但它只影响#注释。

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

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

如何将“”“”“”字符串的颜色更改为自定义颜色,或至少更改为普通字符串颜色?

英文:

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?

答案1

得分: 0

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

关于为什么图片中的两个三重引号字符串颜色不同,是因为 hhh 被识别为文档字符串。

您可以使用以下设置更改颜色:

"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"
                }
            }
        ]
    }
}
英文:

""" 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.

“Vscode” """ """ 当注释颜色不知何故变成了深绿色时

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"
                    }
                }
            ]
        }
    }

“Vscode” """ """ 当注释颜色不知何故变成了深绿色时

huangapple
  • 本文由 发表于 2023年7月3日 10:07:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76601483.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定