Skip to content

Add option to place new line after close brace #512

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

Merged
merged 1 commit into from
Feb 22, 2017

Conversation

kapilmb
Copy link

@kapilmb kapilmb commented Feb 22, 2017

No description provided.

@kapilmb
Copy link
Author

kapilmb commented Feb 22, 2017

This adds an option to place new line after close brace. The following setting will now allow cuddled else.

"powershell.codeFormatting.openBraceOnSameLine": true
"powershell.codeFormatting.newLineAfterCloseBrace": false
if (...) {
...
} else {
...
}

One thing to note is that this setting only allows a cuddled else, but it doesn't enforce it, i.e., if a user already has else statements written in a cuddled manner, then the formatter will leave it as is. But, if a user has the statements written in the following form, then the formatter won't change it to the cuddled style.

if (...) {
...
} 
else {
...
}

@daviwil
Copy link
Contributor

daviwil commented Feb 22, 2017

Great, thanks Kapil!

@daviwil daviwil merged commit fd00c13 into develop Feb 22, 2017
@kapilmb kapilmb deleted the kapilmb/newline-after-close-brace branch March 2, 2017 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants