PowerShell / PowerShell/vscode-powershell
formatting should allow brace indent to match contained code indent
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 547
- PR merge metrics
- No merged PRs in 30d
Description
System Details
- Operating system name and version: win7x64
- VS Code version: 1.8.2
- PowerShell extension version: 0.9.0
- Output from
$PSVersionTable:
Name Value
---- -----
PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
howdy y'all,
currently the code formatter indents the braces & sub-controls [elseif/else] to the same level as the control block. i want them indented to the same level as the code.
default ...
if ($TestBool -eq $True)
{
Write-Output '$TestBool is TRUE.'
}
elseif ($TestBool -eq $False)
{
Write-Output '$TestBool is FALSE.'
}
else
{
Write-Output '$TestBool appears to be non-boolean.'
}
what i would prefer ...
if ($TestBool -eq $True)
{
Write-Output '$TestBool is TRUE.'
}
elseif ($TestBool -eq $False)
{
Write-Output '$TestBool is FALSE.'
}
else
{
Write-Output '$TestBool appears to be non-boolean.'
}
yes, it fails to match your documented style. [sigh ...] however,it is far easier for me to read than the style you chose.
i would dearly like to be able to set that indent style. it's whitesmith, i believe.
take care,
lee
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue concerns the PowerShell formatter in the VS Code extension but names no files, tests, or entry points. Start by locating the formatter and its existing formatting settings; done means users can select an indentation style that places braces and else/elseif at the contained-code indent, including the requested Whitesmith style.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, typescript, vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100