Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Functions (and other logic) within Regions should be indented

未关闭
#2,034 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
csharp, powershell

调研方向

首先定位 PowerShell 语言服务使用的默认自动格式化实现,并将其与 issue 中展开和折叠的 Region 示例进行比较。检查当前函数内容的缩进方式,然后确定应如何表示所请求的 Region 嵌套,并通过 formatter 现有的测试或验证路径(如果存在)验证其行为。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
C#
星标
767
派生
266
平均合并
3 天 16 小时
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/PowerShellEditorServices 的其他 Issue

查看 PowerShell/PowerShellEditorServices 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。