PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.71k stars 491 forks source link

Autoformat cmdlet (and parameters) capitalization #1584

Open Ash258 opened 6 years ago

Ash258 commented 6 years ago

Summary of the new feature

Document formatter should be able to convert default cmdlets (and it's parameters) case, when some setting is set. (powershell.codeFormatting.keepcmdletcapitalization)

Before formatting:

get-content "somefile.json" -raw | convertfrom-json

After formatting:

Get-Content "somefile.json" -Raw | ConvertFrom-Json
rkeithhill commented 6 years ago

I like this idea but the formatting is done by the PSScriptAnalyzer module. You might want to make this suggestion on that repo https://github.com/powershell/psscriptanalyzer

Ash258 commented 6 years ago

@rkeithhill Shouldn't this be done by collaborators?? I dont use PSScriptanalyzer, I don't know anything about how this repository integrates it. If i would report it to PSScriptAnalyzer, they could want to know some technically information, which i dont't know.

I am just using this extension and want it to be able to propose me this option. How it is implemented is on collaborators of this repo.

rkeithhill commented 6 years ago

I can submit this request to that repo if you'd like. It's just that you have the best chance of getting a suggestion implemented when you get it to the right people. Right now, all of the powershell.codeFormatting support is provided by the PSScriptAnalyzer module. And the folks (collaborators) that work on that module are different than the folks that work on this one.

Ash258 commented 6 years ago

And thats why I post it here. For me best people for this are in this repo. I dont care about workflow, people, who provide implelementation for anything, or anything else. It's your implementation, you handle it, your way.

Based on what you wrote i should checked 2 repositories, people on them, inspect implementation of everything in this repo and then post this issues into PSScriptAnalyzer, post issue about previous issue into this repository, which would inform you about new changes and suggest to add settings. == Waste of time.

rjmholt commented 6 years ago

@Ash258 This is the distributed-federated model of git-managed, open-source software. It's the dominant model now because it supports separation of concerns and code reuse. But it also means our workflow is exposed.

At this point you are dealing with the implementation, not an abstraction. You're probably going to have to learn how the sausage is made to some extent.

This issue is helpful because it means you don't need to read our codebase -- we can help direct you to the right place. This is also the standard in the .NET Core and VSCode repos.

Since you understand the feature you are asking for, you are the best person to own the issue in PSScriptAnalyzer -- otherwise there is a risk that something else will be implemented.

We'll track the feature request here too though, since (1) it will help others with the same request, and (2) it can track any integration work we need to do.

rjmholt commented 5 years ago

This exists within PSSA now (https://github.com/PowerShell/PSScriptAnalyzer/pull/1117), so there may be some work for us to integrate it