Closed phoerr closed 4 years ago
That's a reasonable request, I'll try to slip it in the next preview. I'll add it as a setting (settable at workspace, user, and machine level).
Thanks for the suggestion!
That'd be great. I like the approach of using a setting versus adding a parameter.
I'll give the next preview a try when it's available.
Thanks!
I have the changes in a preview build available here. Note that this only works with the preview version of the PowerShell extension currently.
If you run New-CommandSuiteSettingFile
in the workspace you want to add settings for a file will be generated (or use the -Scope
parameter to specify per user or machine). You may need to reload the window after making changes to the setting file. You're looking for a setting like this:
# Specifies the case style to use for generated variable names.
# 'CamelCase' - $getChildItemSplat. This is the default.
# 'PascalCase' - $GetChildItemSplat
# VariableCaseType = 'CamelCase'
I'll close this once it makes it to a published release.
This is working great for me! I downloaded that build, and with VS Code 1.45.1
and the PowerShell Preview Extension v2020.6.0-preview
, it's doing exactly what I what.
My settings:
# Specifies the case style to use for generated variable names.
# 'CamelCase' - $getChildItemSplat. This is the default.
# 'PascalCase' - $GetChildItemSplat
VariableCaseType = 'PascalCase'
I tested with the settings file in the Workspace
, User
, and Machine
scopes, and they all behaved as expected.
Fantastic! Thank you for testing so thoroughly ❤️
Included in v1.0.0-beta3, thanks again!
On my team at work, we write a lot of PowerShell and have found
ConvertTo-SplatExpression
very helpful. However, we've also standardized on a naming scheme that says our variable names should begin with an uppercase letter.From the documentation example for
ConvertTo-SplatExpression
, instead of a variable name$getChildItemSplat
, we'd like to see the name$GetChildItemSplat
(with a capital "G").In the previous version (
0.4.0
), I was able to modify the code myself. Seeing as how this will be a compiled DLL in verion1.0.0
, I wanted to put in an issue to see if we could have an option to change this.I'm going to submit a pull request to show an idea I had of adding a new parameter that would allow the user to choose their variable name case.