Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Functions (and other logic) within Regions should be indented

Open
#2,034 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, powershell

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.

Description

Area-Code Formatting Issue-Enhancement
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

Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PowerShellEditorServices

All issues in PowerShell/PowerShellEditorServices

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.