使用 Rust 时禁用 VScode 中类型的背景颜色

raj*_*raj 4 rust visual-studio-code

一段时间后我在 vscode 中使用 Rust。VScode 似乎正在推断类型,并且为其提供了蓝色背景。我想要类型推断,但不想要它的蓝色背景。我怎样才能禁用它?它曾经只是浅灰色的文本。 在此输入图像描述

Spr*_*ite 10

不久前,VScode 的一些更新多次调整了 InlayHint 的默认行为,这引起了很多人的烦恼。

您可以添加它settings.json以恢复 InlayHint 的原始透明背景:

{
    "workbench.colorCustomizations": {
        "editorInlayHint.background": "#00000000",
    },
}
Run Code Online (Sandbox Code Playgroud)

如果你想自定义前景色:

{
    "workbench.colorCustomizations": {
        "editorInlayHint.foreground": "#868686f0",
    },
}
Run Code Online (Sandbox Code Playgroud)