Xcode curly-brace auto-insertion should surround text before the end-of-line
| Originator: | coryalder | ||
| Number: | rdar://13396678 | Date Originated: | 11-Mar-2013 05:51 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 4.6 |
| Classification: | Other Bugs | Reproducible: | Yes |
Summary:
When you are editing a .m file in Xcode, and you have something like this:
if (booleanVariable) [self doSomething];
And you decide to re-factor that into an if-else statement with curly braces, e.g.:
if (booleanVariable) {
[self doSomething];
} else {
[self somethingElse];
}
So you insert a curly-brace between the if () and the method call, and hit return. The result is this:
if (booleanVariable) {
} [self doSomething];
Xcode auto-inserts a curly-brace, that's helpful. It excludes everything between the insertion point and the end-of-line, that's bad.
This effectively renders the auto-insertion of curly braces useless at LEAST 30% of the time, the way I work. For others it may be far more, for others far less.
Please fix. :)
Steps to Reproduce:
Described above. Write "if (booleanVariable) [self doSomething];" in an Xcode .m document, then move the cursor between the ) and the [ and insert a { and a carriage return.
Expected Results:
if (booleanVariable) {
[self doSomething];
}
Actual Results:
if (booleanVariable) {
} [self doSomething];
Regression:
Notes:
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!