It’s gotten to the point where I dread Xcode updates. Every new release adds “features” that never work for me and only get in the way, or trade something that worked for something that doesn’t. Example: a while back Apple “fixed” potential multithreading problems in gdb by simply making it refuse to do what you ask it to. Thanks! Or Fix and Continue–just doesn’t work any more, as far as I can tell. In 3.2, Xcode expanded autocompletion into places I really don’t want it and didn’t provide, as far as I can tell, any easy way to turn it off.
Here’s the not easy way to do it: Paste the following text into a file at ~/Library/Application Support/Developer/Shared/Xcode/Specifications/C.xctxtmacro.
(
{ Identifier = "c.block.if"; },
{ Identifier = "c.block.ifelse"; },
{ Identifier = "c.block.elseif"; },
{ Identifier = "c.block.for"; },
{ Identifier = "c.block.for.i"; },
{ Identifier = "c.block.while"; },
{ Identifier = "c.block.dowhile"; },
{ Identifier = "c.block.switch"; },
{ Identifier = "c.caseblock"; },
{ Identifier = "c.elseblock"; },
{ Identifier = "c.enum"; },
{ Identifier = "c.struct"; },
{ Identifier = "c.union"; },
)
On the other hand, if you’d rather let the editor autocomplete these but you prefer the following curly bracket on the next line, where god intended it to be, you can change Xcode’s sacrilegious behavior thusly:
defaults write com.apple.Xcode XCCodeSenseFormattingOptions '{ "BlockSeparator" = "\n" ; }'
More useful tips here: http://cocoawithlove.com/2008/06/hidden-xcode-build-debug-and-template.html
Post a Comment