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

Detect and Narrow Parameter Sets based on parameters

Open JustinGrote opened this issue 3 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

New-AzADSPcredential has 9 parameter sets image

If I specify parameters that narrow the possible parameter sets, invalid overloads should no longer be shown. Further, the frame should update to show the most recent parameterset.

Proposed Design

This should be doable, it happens in other languages e.g. Typescript.

JustinGrote avatar Mar 16 '22 20:03 JustinGrote

Does this work in PowerShell itself? Like is it doable through the SMA completion API?

andyleejordan avatar Mar 16 '22 21:03 andyleejordan

SMA doesn't show the syntax stuff that we do, but it does have an API that might make it possible (StaticParameterBinder). It's pretty heavy though.

I'd say this is "nice to have" but even if a PR was provided, we'd need to really examine performance impact.

SeeminglyScience avatar Mar 16 '22 21:03 SeeminglyScience

Right, just throwing this up here as a nice to have to make sure it's documented at least.

JustinGrote avatar Mar 16 '22 23:03 JustinGrote

Right, just throwing this up here as a nice to have to make sure it's documented at least.

Oh yeah for sure. If nothing else it's good fuel to justify improving related engine APIs, so please keep 'em coming 😁

SeeminglyScience avatar Mar 17 '22 15:03 SeeminglyScience