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

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

VSCode Color Theme customization for golang method-parameters

问题

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

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

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

  1. [...]
  2. "workbench.colorTheme": "Slack Theme Dark Mode",
  3. "editor.tokenColorCustomizations": {
  4. "[Slack Theme Dark Mode]": {
  5. "textMateRules": [
  6. {
  7. "scope": "variable.parameter.function",
  8. "settings": {
  9. "foreground": "#e21313"
  10. }
  11. }
  12. ]
  13. }
  14. }

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

英文:

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

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

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

  1. [...]
  2. "workbench.colorTheme": "Slack Theme Dark Mode",
  3. "editor.tokenColorCustomizations": {
  4. "[Slack Theme Dark Mode]": {
  5. "textMateRules": [
  6. {
  7. "scope": "variable.parameter.function",
  8. "settings": {
  9. "foreground": "#e21313"
  10. }
  11. }
  12. ]
  13. },
  14. }

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:

确定