PowerShell / PowerShell/PowerShellEditorServices

Formatter stopped working when `md` is used

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

Nobody has claimed this yet.

Issue-Bug Needs: Triage
Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Description

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

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.

Research direction

Reproduce the formatter behavior with autoCorrectAliases enabled, comparing the md example with the working ni and New-Item examples. Trace how the formatter handles the md alias and verify that formatting the sample produces the expected indentation and output instead of doing nothing.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.