PowerShell / PowerShell/PowerShellEditorServices

Allow customization of code formatting rules

未关闭
#552 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

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

描述

In this block of code: https://github.com/PowerShell/PowerShellEditorServices/blob/master/src/PowerShellEditorServices.Protocol/Server/LanguageServerSettings.cs#L209

The list of PSScriptAnalyzer rules used to perform the Formatting function is hard-coded. It would be nice to have a way of extending this list to include custom rules. For example, I have one that removes any trailing whitespace from lines, but it doesn't run if I use VSCode's "Format Document" or "Format Selection" actions.

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 src/PowerShellEditorServices.Protocol/Server/LanguageServerSettings.cs 中第 209 行附近的格式化规则列表开始。跟踪 Format Document 和 Format Selection 操作如何使用该列表,然后确定应如何提供自定义 PSScriptAnalyzer 规则并将其纳入两条路径。完成的标准是,用户可以扩展格式化规则,并且其自定义规则会通过这些编辑器操作运行。

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

评估

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

把新 issue 发到你的邮箱

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