Reputation: 53799
In the latest version of VSCode, the default settings have changed and inline parameter hints are always shown in the code despite me not using any setting for it. How do I disable them?
Example (predicate
and searchString
):
Upvotes: 67
Views: 38606
Reputation: 50074
You can use the editor.inlayHints.enabled
setting. Quoting from the default settings pseudo file:
// Enables the inlay hints in the editor. // - on: Inlay hints are enabled // - onUnlessPressed: Inlay hints are showing by default and hide when holding Ctrl+Alt // - offUnlessPressed: Inlay hints are hidden by default and show when holding Ctrl+Alt // - off: Inlay hints are disabled "editor.inlayHints.enabled": "on",
Note that if you want to control the setting on a per-language basis, there are at least two options. One option is to wrap the setting in a language block, like so (example with TypeScript):
"[typescript]": {
"editor.inlayHints.enabled": "off"
}
The other option for per-language configuration is to check if the extension you're using which contributes inlay hints for that particular language has any settings for controlling it (see also the extension API docs for InlayHintsProvider<T>
). Several extensions enable you to control enablement at a finer level / toggle inlay hints contributed specifically by that extension. To do that, just search "inlayhints" in your settings.json or settings UI. Here are a couple of examples of such extension-specific settings:
From the builtin TypeScript extension: javascript.inlayHints.*
, typescript.inlayHints.*
From the Python extension: python.analysis.inlayHints.*
From the Cpptools extension: C_Cpp.inlayHints.*
From the Clangd extension: clangd.inlayHints.toggle
From the Red Hat Java extension: java.inlayHints.*
From the .NET C# extension: csharp.inlayHints.*
and dotnet.inlayHints.*
From the Rust Analyzer extension: rust-analyzer.inlayHints.*
At the time of this writing, the Dart extension does not contribute finer-grained settings for its inlay hints, and changes the default settings for its language mode including "editor.inlayHints.enabled": "offUnlessPressed"
.
et cetera.
There are also several other related settings for controlling appearance of inlay hints such as font, and in the colour customizations setting, their colouring and font style. Just search for them in the settings UI or trigger suggestions in settings.json to find them. Or see {language,extension}-independent VS Code inlay hint customization.
Note that if you're seeing a "Double-click to insert" prompt over these, that's also part of the inlay hints features. Extensions can give InlayHint
s a textEdit
, which is what enables this.
Upvotes: 6
Reputation: 1405
In the most recent Visual Studio Code, I could find this option under Preferences: Open Settings UI, after pressing ctrl + shift + P
.
Then, find the option Inlay Hints Enabled
and set it to off.
This solved the problem here for me.
Upvotes: 2
Reputation: 53799
You can disable this new default setting by putting this option in your settings.json
file:
"editor.inlayHints.enabled": "off"
The full list of available settings are:
off
offUnlessPressed
on
onUnlessPressed
Upvotes: 99
Reputation: 261
To disable this setting follow these steps :
Step 1: First you need to open 'setting.json'
( CTRL + SHIFT + P and type "Open Settings (JSON)" and click the
matching entry )
Step 2: Add this code in 'setting.json'
"editor.inlayHints.enabled": "off"
Upvotes: 17