vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

Hotkeys to toggle Inlay Hints (Parameter Names, Parameter Types and Return Types)

Open sromeroi opened this issue 4 months ago • 5 comments

The three inlay hints options (Parameter Names, Parameter Types and Return Types) can be switched on and off in the extension settings. But I would like to have them off by default and only enable them when needed, without requiring to go to the Settings.

I would find very useful to have the possibility to define 3 events that can be assigned hotkeys to:

  • Toggle Inlay Hint: Parameter Names
  • Toggle Inlay Hint: Parameter Types and Return Types
  • Toggle all Inlay Hints (Parameter Names, Parameter Types and Return Types).

This would allow to work with Hints either disabled or enabled and toggle them when required.

Thanks.

sromeroi avatar Dec 01 '25 17:12 sromeroi

There's something similar already -- editor.inlayHints.enabled set to offUnlessPressed.

Image

bmewburn avatar Dec 01 '25 20:12 bmewburn

There's something similar already -- editor.inlayHints.enabled set to offUnlessPressed.

Image

Yes, I saw that option while searching for a hotkey, but that's not a real toggle.

You have to keep CTRL+ALT pressed to show the hints, so it's ok to read some piece of code but not to work/move through the code.

Also, for my particular case, that hotkey takes the focus out of the VMware client that I use to work remotely and forces me to click again with the mouse to regain focus in the Guest OS. I don't see how to change that Hotkey it in the "Keyboard Shortcuts" option.

I just bought Intelephense license yesterday and found the Inlay hints to be really useful... but it crowds my screen a bit. Most of the times I already use variable names that match the function/method parameter names so I get kind of "duplicated info", so having a real toggle would be great to work with code in some situations, toggling the Hints when required.

Thanks a lot for your reply.

sromeroi avatar Dec 02 '25 06:12 sromeroi

+1 to this request, normally I don't disable it, but on some codes is almost a must, because renders the screen too crowded. It would be great to enable/disable with a keyboard shortcut.

SalvadorP avatar Dec 02 '25 12:12 SalvadorP

Related vscode issue https://github.com/microsoft/vscode/issues/149019

bmewburn avatar Dec 02 '25 22:12 bmewburn

Related vscode issue microsoft/vscode#149019

So, the issue can also be handled on vscode's side.

Nevertheless, Intelephense could still provide more granularity providing a toggle (because vscode forces to keep the hotkey pressed) and giving one hotkey for "parameter names", one for "parameter/return types" and one for all three.

Thanks for the link, I'm also subscribing to the other issue.

sromeroi avatar Dec 03 '25 07:12 sromeroi