Option to indent code in a #region
Prerequisites
- [X] I have written a descriptive issue title.
- [X] I have searched all issues to ensure it has not already been reported.
Summary
When writing code, I depend heavily on regions to keep things clean. Sometimes even nested regions. I would love it if we have the option to indent the code in a region to easily find where a region starts and ends.
#region: Hello World!
Write-Host 'Hello World!
#endregion
Should be (optinally)
#region: Hello World!
Write-Host 'Hello World!
#endregion
Would be even cooler if the indent is adjustable to 1 or 2 spaces instead of 4
Proposed Design
Add option in the formatter to indent regions and specifying by how many spaces.
Thanks for submitting! I think this needs to be done as a PSScriptAnalyzer rule which will be read as a formatter, you may need to submit there. @bergmeister?
Yes, although regions are not part of the AST and it would need to be a Token based formatting rule, it shouldn't be too bad though so transferring this issue to PSSA repo
Just wanted to ask if there has been any movement on this?
If you don't see any linked PRs, then no. We are open to PRs, it's doable.