那些灰色的框被称为“镶嵌提示”。从那里,搜索发现了这个问题:Is there setting to change the color of inlay hints?配置多年来发生了变化,但最近评论中的示例有效:
"workbench.colorCustomizations": {
"editorInlayHint.foreground": "#888a",
"editorInlayHint.background": "#0000",
},
感谢@kmdreko,这些灰色的东西原来是inlay hints.
但是……貌似是IDE的bug。当应用程序未运行时,应隐藏这些所谓的“嵌入提示”。至少,它们隐藏在我使用的除 Microsoft Visual Studio Code 之外的所有 IDE 中。所以,我认为它是一个错误,即使它是 Microsoft 开发人员的“功能”。
所以,对我有用的解决方案是将嵌入提示的行为设置为
offUnlessPressed
。因此,通过这种方式,我可以通过按住 Ctrl
+ Alt
组合键来手动显示和隐藏这些提示。
{
"editor.inlayHints.enabled": "offUnlessPressed"
}
谢谢你,伙计。