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

Adding an exception to the 'newLineAfterCloseBrace' setting #576

Closed
adbertram opened this issue Mar 17, 2017 · 4 comments
Closed

Adding an exception to the 'newLineAfterCloseBrace' setting #576

adbertram opened this issue Mar 17, 2017 · 4 comments
Labels
Area-Code Formatting Issue-Enhancement A feature request (enhancement).

Comments

@adbertram
Copy link
Contributor

System Details

  • Operating system name and version: MacOS Sierra
  • VS Code version: 1.10.2
  • PowerShell extension version: 0.10.1
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.15
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I like the newLineAfterCloseBrace setting but I'd rather it not apply all the time. For example, in the scenario where I'm using a where or foreach method. https://www.screencast.com/t/KFWP9dDE66z0

This is how I'd like it to format:

@().foreach({

})

However, this is how it does:

@().foreach({

    })

You can see that a bracket ending with a new line isn't always involved with a control statement.

@DarkLite1
Copy link

DarkLite1 commented Mar 8, 2019

Same issue here and I was almost filing a new issue until GitHub suggested it existed already. Verry annoying formatting:

image

Still present in the latest insider:

Version: 1.33.0-insider (user setup)
Commit: 9b849d9de7168eb4f685823bf9b9e27a0a8dae74
Date: 2019-03-08T06:59:35.464Z
Electron: 3.1.3
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 6.2.9200

Any updates if a fix would be possible?

@rkeithhill
Copy link
Contributor

All of the formatting features are provided by the PSScriptAnalyzer. If this issue hasn't already been submitted to that project, please submit it there where the PSSA owners will see it. https://github.com/powershell/psscriptanalyzer

@DarkLite1
Copy link

Thank you @rkeithhill , opened a new issue here as you suggested.

@bergmeister
Copy link
Contributor

@DarkLite1 I will take a look at this issue tonight (by looking at it I think it might already be fixed in the next upcoming version of PSSA). I think we can close this issue now that the issues has been moved to PSSA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Code Formatting Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

5 participants