Swift 3 projects losing syntax highlighting

In Xcode 8 and Swift 3, I am seeing issues on occassion with syntax highlighting.


Mostly seems tied to running an application in the simulator. During the build/launch, the source in the current editor reverts to just highlighting keywords. Symbols from Apple and my own symbols all remain black as do constants (e.g. numbers and strings).


I must select a different file to bring up in the editor, then go back to the problematic one to regain highlighting.


Anyone else seeing this?


Once I get a repeatable case, will file a bug report.


I have already done the usual steps when SourceKitService misbehaves, but no improvements were noticed

  • Remove the DerivedData folder
  • From Terminal: rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
  • Restart Xcode
  • Reboot

Replies

I had a similar problem. Try this thread: https://forums.developer.apple.com/thread/46223