Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode autocomplete stopped working

Tags:

xcode

swift

I am using Xcode 6.1 with a Swift project.

I get the "SourceKit" (iirc) editor crashing issue several times a day but it usually resolves itself and doesn't result in having to close Xcode.

Now the last time it happened it resolved itself but has now taken away all autocompletion calls. Nothing autocompletes, my class functions, UI*, nothing (aside from basic types UInt etc).

I have cleared derived data, removed Xcode and it's related files, re-installed and nothing completes automatically, nor by using the escape key to show suggestions. Autocomplete is definitely checked in preferences as I have been using it for almost a month prior to todays issue.

Has anyone else experienced this? and does anyone have a solution to this problem? Really, really need autocomplete back.

Thanks

like image 805
PersuitOfPerfection Avatar asked Nov 06 '14 15:11

PersuitOfPerfection


People also ask

How do I enable auto complete in Xcode?

Go to Xcode > Preferences > Text Editing again. Quit out of Xcode and then relaunch Xcode. Now go to Code completion and check 'Suggest completions while typing'. Try typing library function or enum and enjoy!

How do I get suggestions in Xcode?

Press the escape key when auto-complete makes the first suggestion. This will display the list. Escape or control-comma will show the list, control-period will accept the current suggestion and (subsequently) rotate through suggestions, control-slash will move to the next placeholder argument that was inserted.

How do I build and run Xcode?

Build, Run, and Debug Your App To build and run your code, choose Product > Run, or click the Run button in your project's toolbar. Xcode analyzes your scheme's targets and builds them in the proper sequence. After a successful build, Xcode launches the associated app.


Video Answer


2 Answers

Yes this is a bug that I have been experiencing for the last few days in 6.1 The solution for us was to stop building on the simulator. Once we did that (and started testing on actual devices) the sourceViewKit started working again. I'm not exactly sure why this is the case, but it seemed to work for us when nothing else did.

like image 153
Glynbeard Avatar answered Sep 20 '22 11:09

Glynbeard


It is definitely a bug. In fact changing to a different simulator (i.e. iPhone 5 to iPhone 5s) and running once does also solve the issue. You do not have to run on actual device (for those who do not have a paid developer license)

like image 25
turkenh Avatar answered Sep 21 '22 11:09

turkenh