14

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: clangd type-hints

This is becoming very obtrusive to me. How can this be turned off? I couldn't find documentation about this feature.

Thanks.

Rui Oliveira
  • 606
  • 8
  • 20

3 Answers3

34

You can go to the command palette (โ‡งโŒ˜P) and start typing clangd: Toggle inlay hints to turn this feature on/off.

Marat Khasanov
  • 356
  • 3
  • 2
16

In the meanwhile I discovered you can create a file called .clangd, and add this:

InlayHints:
  Enabled: Yes
  ParameterNames: Yes
  DeducedTypes: No
Rui Oliveira
  • 606
  • 8
  • 20
  • 1
    Using ParameterNames: No means that you will not see annoying parameter adverisement any more (tested) https://github.com/default-writer/c โ€“ Alan Turing May 17 '23 at 13:24
  • As per the documentation https://clangd.llvm.org/config#files you can have per project and also global per user configuration file (`$XDG_CONFIG_HOME/clangd/config.yaml`). โ€“ foxesque Jul 08 '23 at 09:00
2

ctrl-p then input setting.json and add this line:

"editor.inlayHints.enabled": "off"

BTW, it (inlay hints) is a great feature but sometimes it conflicts with some theme (like gruvbox in vscode).

Daniel Hu
  • 31
  • 1
  • 5