VSCode + Clangd:类型注释变得唐突 - 如何禁用?
我正在使用 VSCode 1.65.0、clangd 扩展以及最新 LLVM (14.0) 中的 clangd。
它似乎引入了一项功能,每当我使用 auto
时它都会显示类型提示。这是一个例子:
这对我来说变得非常唐突。如何关闭此功能?我找不到有关此功能的文档。
谢谢。
I'm using VSCode 1.65.0, the clangd extension, and clangd from latest LLVM (14.0).
It seems to have introduced a feature where it displays type-hints whenever I use auto
. Here is an example:
This is becoming very obtrusive to me. How can this be turned off? I couldn't find documentation about this feature.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以转到命令选项板(⇧⌘P 或 Ctrl+Shift+P)并开始输入
clangd: Toggle inlayhins
来打开/关闭此功能。You can go to the command palette (⇧⌘P or Ctrl+Shift+P) and start typing
clangd: Toggle inlay hints
to turn this feature on/off.与此同时,我发现您可以创建一个名为
.clangd
的文件,并添加以下内容:In the meanwhile I discovered you can create a file called
.clangd
, and add this:ctrl-shift-p
然后输入setting.json
并添加此行:顺便说一句,它(嵌入提示)是一个很棒的功能,但有时它与某些主题(例如 gruvbox)冲突在 vscode 中)。
ctrl-shift-p
then inputsetting.json
and add this line:BTW, it (inlay hints) is a great feature but sometimes it conflicts with some theme (like gruvbox in vscode).
我会投票关闭此作为 如何在 VS Code 中切换嵌入提示? 的重复(切换嵌入提示是使用
editor.inlayHints.enabled
设置完成),但是还有更多有用的信息使这个问题变得独特 - 特别是 Clangd 扩展有其自己的用于切换镶嵌的设置提示它有贡献。因此,如果您只想切换此特定扩展提供的嵌入提示,请使用其设置:clangd.inlayHints.toggle
。I would have voted to close this as a duplicate of How can I toggle inlay hints in VS Code? (toggling inlay hints is done with the
editor.inlayHints.enabled
setting), but there's more useful info that makes this question unique- particularly that the Clangd extension has its own setting for toggling inlay hints that it contributes. So if you only want to toggle inlay hints contributed by this particular extension, use its setting:clangd.inlayHints.toggle
.