PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

Show parameter help in the parameter tooltips

Open MartinGC94 opened this issue 1 year ago • 7 comments

Prerequisites

  • [X] I have written a descriptive issue title.
  • [X] I have searched all issues to ensure it has not already been reported.

Summary

Similar to how the completion tooltip for commands include a summary of the command, it would be nice if the parameters also included the parameter help. So for ls -Path the tooltip would show:

[string[]]
Specifies a path to one or more locations. Wildcards are accepted. The default location is the current directory (`.`).

Proposed Design

No response

MartinGC94 avatar Oct 22 '24 21:10 MartinGC94

Related to https://github.com/PowerShell/vscode-powershell/issues/3026, when we sort out some of the LSP stuff to keep this from lagging the interface (especially as help can be slow to resolve) or if we can't we can gate it behind a setting and warn that hovers may take longer to resolve.

JustinGrote avatar Oct 23 '24 02:10 JustinGrote

I don't think there's a setting for the command help we get when completing command names and I haven't heard anyone complain about that so I'm not sure if a setting for this is really needed, but of course it doesn't hurt to have it.
I hadn't thought about showing the help when hovering over the parameter but that's a good idea as well.

MartinGC94 avatar Oct 23 '24 09:10 MartinGC94

It's certainly something I want to improve and I'll put it on my to-do list, we just may need to gate it behind a feature flag for some kinds of lookups if it turns out to really slow down the hover/completer

JustinGrote avatar Oct 23 '24 16:10 JustinGrote

@MartinGC94 so as I recall there was an issue with the tooltip getting exposed. Do you see the tooltip in psreadline currently because I don't.

Image

JustinGrote avatar Jul 23 '25 15:07 JustinGrote

I assume you are referring to this issue: https://github.com/PowerShell/PowerShellEditorServices/pull/2222 ? The related PR hasn't been merged yet: https://github.com/PowerShell/PowerShell/pull/25108 so the only tooltip we have today is the type and name you see in the teal color of your screenshot.

MartinGC94 avatar Jul 23 '25 15:07 MartinGC94

@MartinGC94 yep that was it. I am updating how we pull from help so it is more discoverable and accessible. I'll try to nudge that other PR along but if it dies I have a way to provide the info at least to parameters.

JustinGrote avatar Jul 23 '25 15:07 JustinGrote

@andyleejordan I am going to do a partial reimplementation of https://github.com/PowerShell/platyPS/tree/main/src/Transform to facilitate getting this to work until https://github.com/PowerShell/PowerShell/pull/25108 gets merged as it will likely stall during stabilization time for release coming up.

Ideally the PlatyPS team would spin some of this stuff off into a separate non-dependency assembly we could leverage without having to banana-monkey-jungle all of PlatyPS? Downside is they would need to support at least Transform as a public API, but we (as a community) wouldn't have parallel implementations. Thoughts?

CC @adityapatwardhan and @JamesWTruher as well for thoughts.

JustinGrote avatar Jul 24 '25 03:07 JustinGrote