最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

visual studio code - Comment colour change not taking effect - Stack Overflow

programmeradmin2浏览0评论

I found a VSCode theme I really like but the comment colour was too dark. I changed the colour value in settings.json, however it doesn't work. I have done this before with other themes and it has worked, so I'm not sure what's difference in this case.

When I inspect editor and tokens it shows the change but it's shown with a strikethrough:

I have restarted VSCode several times and tried disabling and enabling the theme. When I switch to another theme and switch back it shows the new colour for a split second but then reverts back.

I found a VSCode theme I really like but the comment colour was too dark. I changed the colour value in settings.json, however it doesn't work. I have done this before with other themes and it has worked, so I'm not sure what's difference in this case.

When I inspect editor and tokens it shows the change but it's shown with a strikethrough:

I have restarted VSCode several times and tried disabling and enabling the theme. When I switch to another theme and switch back it shows the new colour for a split second but then reverts back.

Share Improve this question edited Mar 20 at 10:01 Stelio Kontos 6926 silver badges23 bronze badges asked Mar 17 at 14:12 liLeoliLeo 132 bronze badges 5
  • It's being overridden by another extension's textmate rule most likely. Your settings are applied first, then when the other extension is loaded (or the textmate rules applied), they override the previous values you had set. Use process of elimination: disabling other extensions, until your changes are no longer overridden. – Stelio Kontos Commented Mar 18 at 21:46
  • Also, try setting "editor.semanticHighlighting.enabled": false. If that fixes it, then the theme is using semantic tokens, which by default trump textmate rules. – Stelio Kontos Commented Mar 18 at 21:54
  • @StelioKontos The "editor.semanticHighlighting" tip worked, thank you <3 – liLeo Commented Mar 20 at 12:45
  • Glad to hear. I put it in an answer; feel free to mark it as accepted so it's more obvious to future readers what the solution was. – Stelio Kontos Commented Mar 20 at 13:06
  • liLeo, could you mark the answer as accepted answer, please? – Stelio Kontos Commented Mar 23 at 0:51
Add a comment  | 

1 Answer 1

Reset to default 1

Try setting "editor.semanticHighlighting.enabled": false. If that fixes it, then the theme is using semantic tokens, which by default override textmate rules.

发布评论

评论列表(0)

  1. 暂无评论