Xcode 7.3 autocomplete is so frustrating

Autocompletexcode7.3

Autocomplete Problem Overview


There is a new autocomplete in Xcode. Probably might be useful because it checks not only beginning of names etc. But I found that very often it doesn't find a class name or a const name at all etc. I need to type in entire name by myself. Over all I found it makes my life harder and coding more time consuming. Is there a way to switch to the old way it used to work?

Autocomplete Solutions


Solution 1 - Autocomplete

Xcode 7.3.1

  1. In Xcode > Preferences > Text Editing

    uncheck Enable type-over completions

  2. restart Xcode

Solution 2 - Autocomplete

It seems that clearing the checkbox "Enable type-over completions" in XCode -> Preferences -> Text Editing does the trick. At least in my case autocompletion fell back to a sort of old way, so it could autocomplete the class name that I had to type in manually before that.

Solution 3 - Autocomplete

This is by no means an adequate solution, BUT it has allowed me to (barely) maintain my sanity the past few days: After every build, you need to trash your Derived Data folder. You can find this folder in Xcode > Preferences > Locations > Derived Data. Just trash the whole thing and it'll kick off a re-indexing step that should restore proper autocomplete functionality. Unfortunately, I've found that once I build, the autocomplete behavior reverts to its broken state.

Solution 4 - Autocomplete

just open Xcode derived data folder and delete the folder

/Users/yourUserName/Library/Developer/Xcode/DerivedData

then restart Xcode, now autocompletion works like a charm

Solution 5 - Autocomplete

I have the impression that some 'parts' of autocompletion simply fail after a while. I use to restart the Mac to get it back working. But sometimes it fails quite soon again. Maybe the answer of @Alex Bykov combined with a restart will do the trick.

Anyway: auto-completion of Xcode always was crap. AppCode used to get it much better. Unfortunately not yet with swift.

Solution 6 - Autocomplete

Closed Xcode, opened Xcode, let it index, it worked.

Solution 7 - Autocomplete

> it doesn't find a class name

As a work-around, you can try to press Command + Shift + K and Command + B Several times,it works temporarily.

Solution 8 - Autocomplete

Xcode 7.3.1

I will share another posible reason, that after couple of days we found out. We have multiple schemes, and in one of them, the bridging header was importing a file that didn't exist anymore. So, it didn't break while compiling and running (the header belongs to another scheme) but it caused the autocompletion to break (couldn't find any objective-c class).

Hope it would help someone!

Solution 9 - Autocomplete

After having tried different methods:

  • Delete Derived Data
  • Switching Module Enabled off in Build Settings
  • Full Clean
  • Relaunch

Only this worked:

  • Find any commented out (/* abc */) code after @end in your files and delete.

Credit to Max_B: https://forums.developer.apple.com/thread/7439

In my case, other projects were auto-completing correctly. If all your projects fail to correctly predict code, then it might be a different issue, and the other answers might work.

Solution 10 - Autocomplete

I ran into this issue while trying to make an OS X app and I was able to fix this issue by making sure that the Xcode 7.3 documentation and the OS X 10.11.4 documentation was actually downloaded. Doing this fully restored my autocomplete functionality. My full instructions are below as well as in my answer to a similar question: https://stackoverflow.com/a/39420664/3444925

> I had this problem myself and after looking through all the other similar questions & answers about this, I couldn't find a solution. However, I finally found what worked for me.

>Go to Xcode -> Preferences -> Components. There you will probably find a screen that looks like the following:

>enter image description here

>This shows that the documentation has not has not been downloaded and therefore, any attempts to re-index or re-build the application without downloading the documentation would prevent you from being able to use the autocompletion functionality.

>Once I downloaded the Xcode 7.3 Documentation and the OSX 10.11.4 Documentation, this was enough for me to get the autocomplete functionality back (I was trying to build an OS X app, so feel free to download as much documentation as is relevant for you).

Solution 11 - Autocomplete

I didn't run into this until I created a couple of new class files. Other classes worked fine, but autocomplete would NOT work for anything in the new files...

FIX (for me) - I had to add those files to ALL of my targets, including the unit test targets even though I wasn't using them yet.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmatthewfxView Question on Stackoverflow
Solution 1 - AutocompleteTedView Answer on Stackoverflow
Solution 2 - AutocompleteAlex BykovView Answer on Stackoverflow
Solution 3 - AutocompleteevanflashView Answer on Stackoverflow
Solution 4 - AutocompleteHashem AboonajmiView Answer on Stackoverflow
Solution 5 - AutocompletebrainrayView Answer on Stackoverflow
Solution 6 - AutocompleteJuan BoeroView Answer on Stackoverflow
Solution 7 - AutocompleteZGMF-X42SView Answer on Stackoverflow
Solution 8 - AutocompleteErnesto FernandezView Answer on Stackoverflow
Solution 9 - AutocompleteJohnny RockexView Answer on Stackoverflow
Solution 10 - AutocompletejkunzikaView Answer on Stackoverflow
Solution 11 - AutocompleteghostatronView Answer on Stackoverflow