PowerShell / PowerShell/PowerShellEditorServices

Formatter stopped working when `md` is used

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

还没有人认领这个 Issue。

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

描述

Prerequisites
  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with PowerShell Editor Services itself and does not reproduce in a standalone PowerShell instance, and is not an issue with my editor.
  • I have verified that I am using the latest version of PowerShell Editor Services.
  • If this is a security issue, I have read the security issue reporting guidance.
Summary

formatter stopped working when code contains md(the alias of mkdir function)

PowerShell Version
> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             NixOS 25.11 (Xantusia)
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Editor Version
$ nvim --version

NVIM v0.11.5
Build type: Release
LuaJIT 2.1.1741730670
Run "nvim -V1 -v" for more info
PowerShell Editor Services Version
4.4.0
Steps to Reproduce
  1. enable autoCorrectAliases lsp setting
  2. format following code
    md foo
    
    if ($foo) {
    echo foo
    }
    
  3. nothing happened
  4. format code without md
    ni foo
    
    if ($foo) {
    echo foo
    }
    
    succeeded
    New-Item foo
    
    if ($foo) {
        Write-Output foo
    }
    
Visuals

No response

Logs

No response

贡献指南

打开贡献指南

从这里开始

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

调研方向

在启用 autoCorrectAliases 的情况下复现 formatter 的行为,将 md 示例与正常工作的 ni 和 New-Item 示例进行比较。跟踪 formatter 如何处理 md 别名,并验证格式化该示例会产生预期的缩进和输出,而不是无任何操作。

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

评估

技术栈
powershell
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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