Search code examples
constructorintellisense

Why does Intellisense add unnecessary details to constructors?


I'm just switching to VSCode and I've been trying to disable some annoying features with Intellisense. One of my biggest annoyances is shown below, where it keeps telling me what data type the parameters are when constructing a new object.

When I disabled the extension this went away, but I generally like most of the Intellisense features, so I'd like a way to turn off this one particular feature. I keep confusing it for real characters and try to delete them, ending up deleting part of my constructor statement. Note: here I'm trying to remove the cost: and predecessor: parts that show up.

enter image description here

Can this be disabled?

Edit

The source of the issue is Intellisense, as when I disable it the extra text goes away (specifically when I disable the "Language Support for Java(TM) by Red Hat" extension which includes Intellisense). Below see another 2 examples of what I have vs what I'm looking for.

What I have:

enter image description here

What I want:

enter image description here


Solution

  • These are inlay/inline hints. You can disable them from the settings or settings.json.

    What you have

    Search up hints in your settings menu and change the editor.inlayHints.enabled setting to "off" (see the picture below). Alternatively, you can find the Java extension and change the setting from whatever you have (the default is "literals") to "none".

    enter image description here

    After that it should be fixed:

    Fixed

    Quick note, this looks like a duplicate of How do I remove inline parameter hints in VSCode?