Open JustinGrote opened 1 year ago
According to @SeeminglyScience we'll need support in PowerShell itself in order to do this.
@SeeminglyScience without looking at the code I assume the API is the same one when you call a constructor without parens:
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?
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.
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.
Prerequisites
Summary
Today, available method/constructor overloads are shown when you get to the method body or an open parens
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.