Xcode 7.3 autocomplete is so frustrating
Asked Answered
C

11

96

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?

County answered 23/3, 2016 at 3:8 Comment(7)
Those of use who dealt with 7.3 as a beta have been complaining about that for weeks: #35586556Pulchritudinous
you can download older xcode manually on the developer.apple.com/downloads , e.g. xcode 7.2.1: adcdownload.apple.com/Developer_Tools/Xcode_7.2.1/…Mcclimans
I can't believe they put out a major release with something as important as auto-complete broken. It's as if no one at Apple actually uses Xcode for development.Interstratify
This is hitting my productivity so badly that I'm reverting back to Xcode 7.2.1 so I can actually get back to normal development speed again. I'm more than usually annoyed with Apple with this one. Not only have they forced me on to El Capitan to run Xcode 7.3 but when I get there I find the promised land is far from an actuality. Do they test this stuff at all? Typical disrespect for 'their' developers, as ever.Pyre
I've decided to switch to the AppCode because of it...County
In Cocoa (OS X), cannot, for any kind of keyword, get the viewForTableColumn (NSTableViewDelegate) to complete. Need to copy/paste manually. Unbelievable. To be clear, this is Objective-C stuff, not even Swift (of which completion was always somewhat broken). Sent a bug report to Apple.Brennan
Xcode 7.3.1 was released yesterday, after my tests, this bug still exists... But Apple say they fix it in 7.3.1.Euhemerize
P
18

Xcode 7.3.1

  1. In Xcode > Preferences > Text Editing

    uncheck Enable type-over completions

  2. restart Xcode

Pneumothorax answered 29/7, 2016 at 6:32 Comment(0)
S
14

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.

Selfrenunciation answered 25/3, 2016 at 10:16 Comment(3)
Tried it, but it still doesn't complete class names properly.Premaxilla
I don't see a difference. Still need to finish custom names... :(County
To make this work you have to turn on indexing. To turn on indexing you can't do it from within Xcode. You have to execute the following line in a shell. Then restart Xcode. % defaults delete com.apple.dt.Xcode IDEIndexDisable see #7328541Maypole
C
5

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.

Chemisorption answered 27/4, 2016 at 21:6 Comment(0)
L
4

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

Luau answered 25/9, 2016 at 7:7 Comment(1)
This worked for me, I don't know why it is negatively rated.Sika
B
1

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.

Bidle answered 31/7, 2016 at 16:1 Comment(0)
G
1

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

Gormand answered 11/11, 2016 at 18:46 Comment(1)
Sadly it's the only option.Caston
S
0

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.

Sorbose answered 30/3, 2016 at 5:46 Comment(2)
Did Cmd + Shfit + K (Clean), Cmd + Shfit + Opt + K (Clean Build Folder), closed Xcode, deleted ~/Library/Developer/Xcode/DerivedData, rebooted OS X, and it still didn't help. :-)Rational
We have a pretty big project which takes 20 minutes to compile from scratch, so clean and rebuild is not an option for us...True
B
0

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!

Bede answered 2/8, 2016 at 15:4 Comment(0)
M
0

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.

Mettlesome answered 17/1, 2017 at 19:13 Comment(0)
M
-1

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://mcmap.net/q/219431/-xcode-7-3-autocomplete-issues

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).

Metamorphose answered 9/9, 2016 at 22:51 Comment(2)
Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.Querulous
I just added my full answer here as a block quote here @QuerulousMetamorphose
L
-1

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.

Laurice answered 16/9, 2016 at 19:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.