VSCode颜色主题自定义适用于golang方法参数。

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

VSCode Color Theme customization for golang method-parameters

问题

我正在尝试找到一种在VSCode中为'foo'、'a'和'b'着色的方法(语言:golang):

func (foo *Foobar) Subscribe(a string, b int) {
    logger.Log(a)
    logger.Log(b)
}

我该如何实现这一目标?我已经尝试编辑settings.json并添加了以下内容:

[...]
"workbench.colorTheme": "Slack Theme Dark Mode",
"editor.tokenColorCustomizations": {
    "[Slack Theme Dark Mode]": {
        "textMateRules": [
            {
                "scope": "variable.parameter.function",
                "settings": {
                    "foreground": "#e21313"
                }
            }
        ]
    }
}

参数没有采用我设置的颜色。

英文:

I'm trying to find a way to color 'foo', 'a' and 'b' in VSCode (language: golang):

func (foo *Foobar) Subscribe(a string, b int) {
	logger.Log(a)
	logger.Log(b)
}

How can I go about achieving this? I have tried editing settings.json and added this:

    [...]
    "workbench.colorTheme": "Slack Theme Dark Mode",
    "editor.tokenColorCustomizations": {
        "[Slack Theme Dark Mode]": {
            "textMateRules": [
                {
                    "scope": "variable.parameter.function",
                    "settings": {
                        "foreground": "#e21313"
                    }
                }
            ]
        },        
}

The parameters don't pick up the color I set.

答案1

得分: 1

很抱歉,不支持翻译代码部分。你只能将 source.go 部分进行高亮显示。

英文:

Unfortunately it's not supported, all you can do is highlight source.go.

huangapple
  • 本文由 发表于 2021年8月13日 20:49:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/68772635.html
匿名

发表评论

匿名网友

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

确定