Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Align Equal Sign on Enum Statement #5138

Open
2 tasks done
leewilmott opened this issue Feb 13, 2025 · 3 comments
Open
2 tasks done

Feature Request: Align Equal Sign on Enum Statement #5138

leewilmott opened this issue Feb 13, 2025 · 3 comments
Labels
Area-Code Formatting Area-Script Analysis Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! Pending: External This issue is not fixed here, it is fixed in a dependent repo such as PowerShell,PSScriptAnalyzer

Comments

@leewilmott
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

The vscode-powershell extension appears to align the equal signs on hashtables, but it doesn't align the equal signs within the Enum statement.

Given the following...

    Enum TestEnum {
        one = 1
        three = 3
        four = 4
        seven = 7
        eleven = 11
    }

    $testHashTable = @{
        one = 1
        three = 3
        four = 4
        seven = 7
        eleven = 11
    }

...it reformats it to this...

    Enum TestEnum {
        one = 1
        three = 3
        four = 4
        seven = 7
        eleven = 11
    }

    $testHashTable = @{
        one    = 1
        three  = 3
        four   = 4
        seven  = 7
        eleven = 11
    }

Proposed Design

If the Enum statement contains equal signs then I would expect that the equal signs would be aligned like this...

    Enum TestEnum {
        one    = 1
        three  = 3
        four   = 4
        seven  = 7
        eleven = 11
    }
@leewilmott leewilmott added Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! labels Feb 13, 2025
@JustinGrote
Copy link
Collaborator

Thanks for your submission! Formatting comes from scriptanalyzer, and this is a dupe of PowerShell/PSScriptAnalyzer#1739. Once the issue is fixed there, it should work in the next version of the PowerShell extension once the module is incorporated. I'm going to leave this issue open for tracking but note that there is nothing we will do here to fix this.

@JustinGrote JustinGrote changed the title Align Equal Sign on Enum Statement Feature Request: Align Equal Sign on Enum Statement Feb 13, 2025
@JustinGrote JustinGrote added the Pending: External This issue is not fixed here, it is fixed in a dependent repo such as PowerShell,PSScriptAnalyzer label Feb 13, 2025
@JustinGrote
Copy link
Collaborator

@andyleejordan FYI I created a new Pending-External label to apply to issues such as this where the fix is downstream in PowerShell/PSScriptAnalyzer/etc.

@andyleejordan
Copy link
Member

Thanks Justin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Code Formatting Area-Script Analysis Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! Pending: External This issue is not fixed here, it is fixed in a dependent repo such as PowerShell,PSScriptAnalyzer
Projects
None yet
Development

No branches or pull requests

3 participants