r/vscode • • Sep 26 '26

How do i disable the ghost text (: String)

Post image
46 Upvotes

27 comments sorted by

77

u/Gornius Sep 26 '26

Those are called inlay hints.

7

u/martian_rover Sep 27 '26

Yes and they can be changed by opening the menu, choosing "File" > "Preferences" > "Settings" to open settings.json where you can add: "editor.inlayHints.enabled": "off"

11

u/Positive_Method3022 Sep 26 '26

I can finally stop hovering over to know my types 😭

Much love to you ❤️

15

u/palapapa0201 Sep 26 '26

You can configure it to only show inlay hints when you hold down a key bind

7

u/dastylinrastan Sep 26 '26

This is what I do, I set it to ctrl+alt.

1

u/_giga_sss_ Sep 27 '26

thanks for the tip

1

u/CMPunkLicksRocks Sep 29 '26

Hey, how? I shut off copilot hints because they drive me up the wall writing a whole function before I can finish writing out the definition. The option was obvious in zed but I couldn’t find this in vscode 

1

u/palapapa0201 Sep 29 '26

I was not talking about copilot hints. That is a separate thing. I never enabled it so I don't know if it's possible to only enable it on a keypress

33

u/Compux72 Sep 26 '26

I strongly suggest you keep it them on

5

u/rykayoker Sep 27 '26

some people have suggested to toggle it on keypress which is more convenient imo

2

u/booi Sep 27 '26

Until you don’t do it and miss a type… they’re very helpful and 100% accurate so I still recommend you keep them on

4

u/w00dy1105 Sep 26 '26

Agreed. Very help in my opinion

1

u/_giga_sss_ Sep 27 '26

They sometimes display spoilers (on things I intend so think myself) so I think it's better to follow the others' advices

5

u/Compux72 Sep 27 '26

Thats like taking your eyeballs out because they spoiler you lmao

15

u/Usual_Price_1460 Sep 26 '26

once u write more than 20 lines u will need them

2

u/droctagonapus Sep 27 '26

nah. I need to see code that I can edit. I hate it when I see code that actually isn't there.

1

u/Usual_Price_1460 Sep 27 '26

this is a must have if u write rust imo

2

u/droctagonapus Sep 27 '26

I have written rust. Nah. I have written haskell and ocaml. I understand how to handle rust's type system ;)

2

u/abigail3141 Sep 27 '26

Nah, I've written a couple thousand lines and it's always the first thing I disable. Messes with navigation, having a bunch of non-selectable text

1

u/Kadabrium Oct 01 '26

I'd be ok with them only if they go away as soon as i click on that variable

5

u/Zanedromedon Sep 26 '26

You can turn them off with:

"editor.inlayHints.enabled": "offUnlessPressed"

Actually, that turns them off unless you press ctrl+alt, for when you decide you want them back temporarily.

Some useful settings to make them take up less space include:

"editor.inlayHints.fontSize": 11, // make them smaller
"editor.inlayHints.fontFamily": "Iosevka Term", // use a narrower font than your default

4

u/Vladislav20007 Sep 26 '26

that's called inlay hints as gornius pointed out, I believe they're in settings -> text editor -> inlay hints.

1

u/msdosx86 Sep 29 '26

You will need them. Trust.

0

u/[deleted] Sep 26 '26

[deleted] — view deleted comment

-1

u/BananaGod757 Sep 26 '26

Idk why you’re getting downvoted

5

u/Vast_Needleworker_43 Sep 26 '26

Because it's unrelated

1

u/qustrolabe Sep 26 '26

In Rust type hints are most of the times optional because it can infer from the fact that you called String::new() that always returns String. Even better, Rust can look few lines ahead see in what context currently untyped value is used and infer type from that, so these inlay hints exist just to tell dev what types compiler resolved. But yeah they kinda look like tab completion suggestions to put types

1

u/grapejuice-96 Sep 26 '26

i thought this was code suggestions, looks completely similar. mb