Xcode syntax highlighting fix

Over the last couple of months of use of Xcode 4, I’ve found that (at times) everyone’s favourite Objective-​C IDE loses its way while making code pretty and colourful. I’ve filed radars about it, but I could never reliably and consistently reproduce the problem so the Xcode gnomes at Apple couldn’t either.

If you’re having trouble with syntax highlighting in your Xcode projects, please try this tip from Lars Schneider:

  1. Increase the indexing log level by opening Terminal.app and executing the following command:

    defaults write com.apple.dt.Xcode IDEIndexingClangInvocationLogLevel 3

  2. Open Console.app and search for “Xcode” — specifically for “file not found” errors for header files mentioned in your PCH (Pre-​Compiled Header)

  3. Fix any problems that are reported in the console logs.

Lars mentions adding “$(SRCROOT)/**” to your project header search paths in his answer, but I didn’t find that to be necessary.

The good news is that Xcode 4.2 seems to improve this situation (and a bunch of others), so grab a copy when it’s released later this week.

Thanks to Rafif Yalda for pointing me in the direction of Lars’ Stack Overflow post this morning!

Comments

Gravatar for okay.

I don’t have these problems in AppCode…

Posted by okay on

Gravatar for Tony Arnold.

That’s great, but AppCode has a java-​based UI with a less than optimal user experience in my opinion. I prefer to put up with a few syntax highlighting quibbles in Xcode 4 over the whacky cross-​platform java GUI of AppCode.

Posted by Tony Arnold on

Gravatar for okay.

The latest beta has a native look-​and-​feel. Plus, the number of automatic refactorings and code generation tools are just out of control.

Posted by okay on

Gravatar for okay.

Not trying to sound like an ad. If it’s not for you, it’s not for you. But about a million little Xcode headaches have disappeared from my life since I abandoned it.

Posted by okay on

Gravatar for Tony Arnold.

@okay — that’s OK — I leave comments enabled here so that I can get other opinions :)

However, what’s present in the current AppCode beta is not a native look and feel. I downloaded the latest beta this morning, and it still looks like Frankenstein’s monster. Closer to a “real” mac app, but enough to turn me off.

I don’t know about others, but I look forward to getting up each day to see crisp, clean code on my screen — and I want the app that I write that code in to be crisp, clean and clear as well. I won’t debate that AppCode’s refactoring tools are very, very powerful (I used Intelli-​J in a previous life) — but to me, user experience is just as important as the power of the tools I’m using.

Posted by Tony Arnold on

Sorry, this conversation has finished.

This post is a bit old now, so I've closed the conversation. If you're keen to keep talking about it, please email me directly.