首页 > 解决方案 > 如何激活 Visual Studio 代码中的错误波?

问题描述

我最近开始使用 Visual Studio Code for C++(安装的扩展:C++ 和 Code Runner),有时即使一切都正确,代码下的那些红色错误波也会显示,然后唯一的“快速修复”选项是停用它们。我对海浪很恼火,所以我停用了它们——现在我不知道如何重新激活它们(嗯,大多数时候它们实际上是有帮助的)!我在设置中一无所获,即使在重置所有内容后他们也没有回来。你能给我一个提示如何再次激活它们吗?

标签: c++visual-studio-codesettings

解决方案


要在 Visual Studio 代码中禁用或启用波浪/波浪下划线,请转到 file\preferences 并更改一些设置

要禁用:

{
    "workbench.colorCustomizations": {
        "editorError.foreground":   "#00000000",
        "editorWarning.foreground": "#00000000",
        "editorInfo.foreground":    "#00000000"
    }
}

启用:(此颜色是建议):

{
    "workbench.colorCustomizations": {
        "editorError.foreground":   "#ff000088",
        "editorWarning.foreground": "#ffe60033",
        "editorInfo.foreground":    "#00ff0088"
    }
}

推荐阅读