PowerShell / PowerShell/PowerShellEditorServices
Functions (and other logic) within Regions should be indented
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 767
- Forks
- 266
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 1
Description
Summary of the new feature / enhancement
Indentation should incoprorate Regions, if they exist. This logic is akin to why the contents of functions is indented.
Note: I have searched and found no support for this, and Found no better place to request this enhancement. I am using Visual Studio Code with the MS PowerShell Plugin. Language specific Editor settings do not support doing this: https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings
___ is used instead of spaces because the View of the issue removed spaces
Preferred:
================
Expanded:
Region Main
___Function Main {
______ValidateSettings
Collapsed:
Region Main
___Function Main {
___}
___Function Function1 {
___}
___Function Function2 {
___}
Current:
Expanded:
Region Main
Function Main {
_____ValidateSettings
Collapsed:
Region Main
Function Main {
_____ValidateSettings
}
Function Function1 {
}
Function Function2 {
}
Proposed technical implementation details (optional)
The Default Auto-Formatting should indent Functions when they exist within Regions.
Not preferred, as this is user by user: provide language-specific-editor-settings to enable this
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
Start by locating the default auto-formatting implementation used by the PowerShell language service and compare it with the issue's expanded and collapsed Region examples. Check how function contents are currently indented, then determine how the requested Region nesting should be represented and validate the behavior through the formatter's existing test or verification path, if one is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100