Why is VS Code showing this these labels or parameter names for System.out.println() in java files?

Viewed 3576

I have the java extension pack installed. This just started happening today. Not sure if this is due to some json settings or something else.

inlay hints in java files

7 Answers

The newest extension has enabled inlay hints. They are actually helpful, but if you want to remove them:

Mac: Code -> Preferences -> Settings Windows: File -> Preferences -> Settings.

**Type "inlay" in the search, and disable inlay hints.

To disable this setting Open 'setting.json' file

(CTRL + SHIFT + P and type "Open Settings (JSON)" to open setting.json)

Add this code in this file

  "editor.inlayHints.enabled": "off"

enter image description here

lets say you have a function setPassword that takes parameter of the name newPasswordandoldPassword. So, when you call that function, it would hightlight what the parameter is supposed to be. like


setPassword(newPassword: "SOME_NEW_PASSWORD",oldPassword:"SOME_OLD_PASSWORD")


This is supposed to reduce any confusion as to what value you entered is what. Extremely helpful when working with functions that take multiple parameters.

None of this worked for me so here is how I fixed it:

When I did settings through CTRL + SHIFT + P and type "Open Settings (JSON)", an uneditable JSON file would pop up called defaultSettings.json that had the setting I needed to change.

Here is an image of this file: defaultSettings.json

I had to find settings through the file directory (win + R) %APPDATA% -> Code -> User -> settings.json

Then I just added "editor.inlayHints.enabled": "off",

Make sure to add a comma at the end of the previous line if there was not an existing one or else an error will appear.

Here is an image of the settings.json file: settings.json

It's called inlay hints. You can set that to not show unless needed.

In Command Palette -> Language Specified Settings -> Java -> Search for inlay
-> Enable or Disable.

P.S. It's really helpful in debugging Problems, So you can set it to "offUnlessPressed".

Related