So I’ve been going crazy everytime my XCode project just stops autocompleting my swift code. It’s an annoying problem.

I like swift. I get it that it’s a new language, and expecting the compiler to be able to compile on-the-fly why I am typing it is a pretty high threshold (for a new language).

But there is a single repeatable issue that has plagued my in EVERY single Xcode version that supports Swift — The editor stops autocompleting.

My current theory of what is happening is this:

project index is constantly being updated by the compiler. That’s part of the it’s job. If I change the code, automatically change the index. the swift compiler is looking at my code… and crashing. Showing me that friendly “internal error” that likes to flash a few times. the swift crash it taking out the code index. Probably corrupting it. After that autocomplete just totally fails.

Currently the fix for this is to close XCode… Find your derivedData directly.. Delete everything.. restart.. reindex.

It’s annoying. It takes time. I keep weighing whether the “pain of not having autocomplete” is greater than the “pain of dumping my DerivedData”.

So I looked for a good solution.

Today I found: WatchDog for Xcode

Originally written to automatically manage your DerivedData, it can also be used to force XCode to re-index your code. There is even a quick keyboard shortcut.

Now if autocomplete stops, just click “Clean Now” on the tiny bulldog on the menu bar. Wait a few minutes. Indexing retstarts.

Yay!

Totally worth 2.99.