PowerShell / PowerShell/PowerShellEditorServices

Functions (and other logic) within Regions should be indented

オープン
#2,034 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Area-Code Formatting Issue-Enhancement
主要言語
C#
スター
767
フォーク
266
平均マージ
3日 16時間
マージ済み PR(30日)
1

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、PowerShell 言語サービスで使用されているデフォルトの自動フォーマット実装を見つけ、issue の展開された Region の例と折りたたまれた Region の例を比較します。現在、関数の内容がどのようにインデントされているかを確認し、次に要求された Region のネストをどのように表現すべきかを判断して、formatter に既存のテストまたは検証パスがあれば、それを通じて動作を検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, powershell
領域
developer-experience, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。