Xcode should have better support for curly braces on the next line

Originator:igeek1
Number:rdar://16300492 Date Originated:12-Mar-2014 10:52 AM
Status:Duplicate of 5785153 Resolved:13-Mar-2014 07:40 PM
Product:Xcode Product Version:Xcode 5.1 (5B130a)
Classification:UI/Usability Reproducible:Always
 
Summary:
There are many good reasons to put curly braces on the next line; enough so that some companies and individuals use it as their coding standard. Most (but not all) of Xcode’s build-in autocompletion snippets leave the brace on the same line. There should be a way to choose, or a way to soft-wrap braces without affecting the source code.

Steps to Reproduce:
1. Open an Xcode project.
2. Edit a C or Objective-C source file.
3. Type “if” (no quotes), wait for the CodeSense popup to appear, and press Return to create an if statement.

Expected Results:
The opening curly brace is on the next line if that is how I or my company prefers to work.

Actual Results:
The opening curly brace is on the same line as the condition.

Version:
Xcode 5.1 (5B130a)

Notes:
I maintain a project on GitHub that patches the built-in snippets file in Xcode: https://github.com/ZevEisenberg/ios-convenience

There are good enough arguments on both sides that it would be nice to have some kind of soft wrap approach, so that if you prefer next-line but your team uses same-line, you can configure Xcode to display one format but save another. I can’t think of any cases where the intent of the braces is ambiguous, so it should at least in theory be possible.

Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!