xcodeswiftsourcekit

How do I restore indexing functionality? (Xcode)


One of my projects (containing over 200 files in pure Swift) has just recently started interfering with the indexing process. The indexing process freezes midway and then stops abruptly, causing SourceKitService to crash.

I simply cannot find the faulty code; because there appears to be none!

My code compiles just fine (without a single warning!) - and yet it fails to be indexed. Initially, I thought it to be an Xcode 7.2 issue and so upgraded to the latest beta (7.3); however the issue still persists. I cannot revert back to my old code because too much work will be undone, and I can't spot a particular file to blame. The crash report is here.

To clarify, Xcode itself does not crash, only the indexing process (and SourceKitService as a consequence).

Any ideas on how to go about fixing this?


Solution

  • Remove "xcuserdata" from .xcodeproj (right click on .xcodeproj > select Show Package Contents. This should solve the problem.