在 Neon Night VSCode 主题中,他如何使用错误破折号而不是波浪线?

In the Neon Night VSCode theme, how does he do error dashes instead of squiggles?

我喜欢破折号效果而不是 Neon Night VSCode theme, but some of the ui colors are a little bright for me. Anyone know how it is achieving the effect? I'm trying to apply the effect to a different theme, and have even downloaded/combed through the GH repo 中的波浪形效果,但还没弄明白。如果已经有人问过这个问题,我深表歉意。如果我的google-fu坏了,请见谅

我找到了'offending color'。

"editorUnnecessaryCode.border": "#FF8E8E"

我通过主题条目的二元消去找到了这个。

我认为它是用文本装饰器实现的,因为我用VSC的开发工具找不到span的样式。

破折号装饰通常由语义代码检查创建。波浪线是句法检查的结果。所以它不是主题特色,与其他主题看起来相似。

将鼠标悬停在破折号装饰上以查看 vscode 建议的操作。

这里是主题作者,这也作为问题发布在回购协议上,我写了回复 on the issue

这是我分享的...

您想使用这些选择器:

editorError.foreground:错误波浪线 editorWarning.foreground:警告波浪线 editorInfo.foreground:信息波浪形

https://github.com/chaseadamsio/vscode-theme-neon-night/blob/mainline/src/colors/editor.js#L42-L45

您也可以在 workbench 上设置这些(这样您就可以使用自己喜欢的主题而无需分叉),方法是将它们添加到您的 settings.json,如下所示:

{
  "workbench.colorCustomizations": {
    "editorError.foreground": "#f00"
  }
}

您可以阅读更多关于它们的信息 here 并搜索“错误和警告”。