记录

在这里使用Error Lens扩展遇到了一个问题,就是他会显示 Unknown word 语法的问题,这里看到这个显示是有点烦的,但这个扩展好用,又不想卸载,这里就去验证了一下,找到了两个解决办法,第一种一劳永逸,第二种使用可能会出现问题,这里看情况选择。

问题预览

第一种

出现这个问题的原因是,你的扩展项有安装 Code Spell Checker 这个扩展,禁用或者卸载即可。

第二种

这里去查询了settings.json设置项,这里看了下,就把背景色和文字颜色删除了。

  1. C:\Users\用户\.vscode\extensions找到usernamehw.errorlens-<版本号>,找到 package.json 这个文件。

  2. 使用CTRL+F按键,查找 errorLens.infoBackground 删除大括号内的配置。

  3. 查找 errorLens.infoForeground 删除大括号内的配置。

Colors (26)

Can be specified in (workbench.colorCustomizations section)settings.json

ColorDarkLightHCDescription
errorLens.errorBackground#e454541b#e4545420#e454541bBackground color of the entire line containing error.
errorLens.errorMessageBackground#e4545419#e4545419#e4545419Background color of the error message.
errorLens.errorBackgroundLight#e4545420#e4545420#e4545420Background color of the entire line containing error (Only in light themes).
errorLens.errorForeground#ff6464#e45454#ff6464Text color used to highlight lines containing errors.
errorLens.errorForegroundLight#e45454#e45454#e45454Text color used to highlight lines containing errors (Only in light themes).
errorLens.warningBackground#ff942f1b#ff942f20#ff942f1bBackground color used to highlight lines containing warnings.
errorLens.warningMessageBackground#ff942f19#ff942f19#ff942f19Background color of the warning message.
errorLens.warningBackgroundLight#ff942f20#ff942f20#ff942f20Background color used to highlight lines containing warnings (Only in light themes).
errorLens.warningForeground#fa973a#ff942f#fa973aText color used to highlight lines containing warnings.
errorLens.warningForegroundLight#ff942f#ff942f#ff942fText color used to highlight lines containing warnings (Only in light themes).
errorLens.infoBackground#00b7e420#00b7e420#00b7e420Background color used to highlight lines containing info.
errorLens.infoMessageBackground#00b7e419#00b7e419#00b7e419Background color of the info message.
errorLens.infoBackgroundLight#00b7e420#00b7e420#00b7e420Background color used to highlight lines containing info (Only in light themes).
errorLens.infoForeground#00b7e4#00b7e4#00b7e4Text color used to highlight lines containing info.
errorLens.infoForegroundLight#00b7e4#00b7e4#00b7e4Text color used to highlight lines containing info (Only in light themes).
errorLens.hintBackground#17a2a220#17a2a220#17a2a220Background color used to highlight lines containing hints.
errorLens.hintMessageBackground#17a2a219#17a2a219#17a2a219Background color of the hint message.
errorLens.hintBackgroundLight#17a2a220#17a2a220#17a2a220Background color used to highlight lines containing hints (Only in light themes).
errorLens.hintForeground#2faf64#2faf64#2faf64Text color used to highlight lines containing hints.
errorLens.hintForegroundLight#2faf64#2faf64#2faf64Text color used to highlight lines containing hints (Only in light themes).
errorLens.statusBarIconErrorForeground#ff6464#e45454#ff6464Status bar icon item error color. Foreground is used when the setting is disabled.errorLens.statusBarIconsUseBackground
errorLens.statusBarIconWarningForeground#fa973a#ff942f#fa973aStatus bar icon item error color. Foreground is used when the setting is disabled.errorLens.statusBarIconsUseBackground
errorLens.statusBarErrorForeground#ff6464#e45454#ff6464Status bar item error color.
errorLens.statusBarWarningForeground#fa973a#ff942f#fa973aStatus bar item warning color.
errorLens.statusBarInfoForeground#00b7e4#00b7e4#00b7e4Status bar item info color.
errorLens.statusBarHintForeground#2faf64#2faf64#2faf64Status bar item hint color.

扩展说明

这里配置使用是因为自己想用而已,这里可以根据你的情况自行调整,如果你认为这样显示也挺好的,可以不进行调整,根据自己的喜好来,这里只是提供一些参考。