Change error highlight color in vs code

前端 未结 3 1291
囚心锁ツ
囚心锁ツ 2021-01-05 16:38

I build a project and get some problems in the \"Problems view\", I click on the problem to see a line of code with that problem highlighted.

And it gets highlighted

相关标签:
3条回答
  • 2021-01-05 17:14

    Apparently, you can actually change it without using an extension. I created an issue and got the answer that this color is called editor.rangeHighlightBackground and you can override it in your User Settings (settings.json) by:

    {
        "workbench.colorCustomizations": {
            "editor.rangeHighlightBackground": "#00AA00"
        }
    }
    

    To open User Settings just use Cmd+, on mac or Ctrl+, on windows

    0 讨论(0)
  • 2021-01-05 17:20

    Check if you can apply a different theme with VSCode 1.52 (Nov. 2020), considering the new feature:

    Error background colors

    Theme authors can now leverage new theme colors for errors in the editor.

    Edior errors, warnings, and infos can now be styled via:

    editorError.background
    editorWarning.background
    editorInfo.background
    

    0 讨论(0)
  • 2021-01-05 17:26

    A wrapup answer:

    For VS Code 1.52+ You can use this snippet to customize error colors:

    "workbench.colorCustomizations": {
         "editorError.background": "#ff80ab66",
         "editorError.foreground": "#d50000",
    }
    

    Available properties: https://code.visualstudio.com/api/references/theme-color

    0 讨论(0)
提交回复
热议问题