-
Notifications
You must be signed in to change notification settings - Fork 511
Add code fix or formatting rule to generate splatted parameters from command invocation #517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yep, I think we could add this as a command in the editor. What do you think @kapilmb? |
Or a code-action, perhaps? Not sure about the timeline though. I would say this will be a great post-1.0 addition. What do you say? |
It could be a suggested code action if the line was longer than a certain length, for sure. However, I think it'd be nice if this was something that could be invoked anytime on a command in a script file. We could try it post-1.0 unless @Jaykul gets to it first ;) |
If there was a rule that gave a |
Yeah, that could work. For the "invoke any time" approach, I think we'd basically just run the rule on the current script line (including any backticked lines following that) and see if a marker gets returned. If yes, apply the correction. |
@daviwil - Has there been any more planning and/or movement on this project? |
We've been occupied with other work lately so we haven't been able to focus on this particular issue. I think the ideal way to add this feature would be through an extension module. Thankfully @SeeminglyScience has done just that :) https://github.com/SeeminglyScience/EditorServicesCommandSuite Check out the Demo section for a GIF that demonstrates its features. |
@SeeminglyScience did a great job in EditorServicesCommandSuite and we shouldn't stomp on his toes in that. That said, @Jaykul hinted at something that this would make an awesome PSScriptAnalyzer rule. I'll close this since folks should either grab ESCS or refer to the issue in PSSA that Rob will post here. |
Can't get EditorServicesCommandSuite to work with the latest vscode and PowerShell extension is there a new setting or config that I am missing? |
@snewfie can you open an issue over in https://github.com/SeeminglyScience/EditorServicesCommandSuite and provide as much info as you can? |
Sapien's PowerShell Studio has a feature that will allow you to convert single line commands to be splatted.
For a visual of what I'm talking about, click here
This would be a great enhancement, I think!
System Details
$PSVersionTable
:The text was updated successfully, but these errors were encountered: