-
Notifications
You must be signed in to change notification settings - Fork 510
Allow PowerShell formatting for "} else {" #740
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
Comments
I know this is closed but I am seeing issues with the if else formatting issue when use VScode. |
@skadlec72 how are you running the code? Are you copying and pasting into the terminal? What operating system are you on? @bergmeister are you aware of a formatter setting that would give this "} else {" behavior? |
@bergmeister I am running the code inside of VSCode terminal set to use windows powershell (not powershell core) and not the integrated terminal. I installed the powershell extension and use the right click option to for document format. I have executed the code by highlighting specific sections and also by saving it and running active file. The results are the same. Also filed as a bug in VSCode, but they pointed me to the extensions instead of product. |
Yes, this cuddled else style is the OTBS (one true brace style) setting of |
@bergmeister Here is sample code: Ironically it is doing exactly what the setting says, but for else it causes an issue, most other situations there are no issues. |
@skadlec72 I cannot reproduce your issue with the stable PowerShell extension and
If I can repro afterwards, then we should open a new issue at https://github.com/PowerShell/PSScriptanalyzer |
System Details
PS > code -v
1.12.1
f6868fce3eeb16663840eb82123369dec6077a9b
PS > $pseditor.EditorServicesVersion
PS > code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
PS > $PSVersionTable
Name Value
PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
The text was updated successfully, but these errors were encountered: