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

Enable "Trigger Parameter Hints" for available method/constructor overloads

Open JustinGrote opened this issue 2 years ago • 4 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

Today, available method/constructor overloads are shown when you get to the method body or an open parens image

However, if you are already in a closed parens and want to see the available method/constructor overloads, this is not available, you have to delete the closed parens and retype them to get the prompt again.

Proposed Design

The C# extension wires up to Trigger Parameter Hints when in the method/constructor parameter body, we should do the same. image

image

JustinGrote avatar May 31 '23 02:05 JustinGrote

According to @SeeminglyScience we'll need support in PowerShell itself in order to do this.

andyleejordan avatar Jun 07 '23 19:06 andyleejordan

@SeeminglyScience without looking at the code I assume the API is the same one when you call a constructor without parens: image

If so, can we "fudge" the completion request to PowerShell to just remove the parens to still get the same result from the API and then display it, or is that too magical?

JustinGrote avatar Jun 09 '23 14:06 JustinGrote

I made a suggestion to add an API for this: https://github.com/PowerShell/PowerShell/issues/19619 feel free to give me feedback on the idea I have for the implementation.

MartinGC94 avatar Jun 11 '23 10:06 MartinGC94

If so, can we "fudge" the completion request to PowerShell to just remove the parens to still get the same result from the API and then display it, or is that too magical?

That'd be a lot more fudging than you're picturing, and we'd still need to actually parse it which would be super finicky.

We'd definitely need something like what @MartinGC94 proposed. I think there's a huge untapped well of potential if we could set up a performant and consistent public API for member/type inference.

SeeminglyScience avatar Jun 11 '23 21:06 SeeminglyScience