Xcode 8.2 code padding not working

For some reason, in Xcode 8.2, my code completion stopped working. I cleaned my product, restarted Xcode, restarted my computer and deleted the received data, and still have no luck. I sent this to Apple Support. Has anyone encountered this before and was able to fix it?

+49
xcode
Dec 19 '16 at 17:19
source share
7 answers

Code completion also stopped working for me in Xcode 8.2.1, and no amount of cleanup, output, or reboot fixed it. After a while, I realized that code completion was broken only in the extension area that I was working on. If you typed manually, the code will be correctly highlighted and compiled in order, so the problem is not that the source code discards all the parser responsible for completing the code.

Here is the specific context in which this occurs in this very simple example:

struct SomeStruct { static let foobar1 = { return NSBezierPath() }() } extension SomeStruct { static let foobar2 = { return NSBezierPath() }() } 

Code completion works fine in the foobar1 implementation foobar1 , but not for foobar2 . This is the presence of static let within the extension, which seems to be causing it. The problem arises for both the structure and the class.

Looks like an error with Xcode, so the only workaround for me was to move foobar2 into the foobar2 main definition.

+13
Jan 13 '17 at 16:34 on
source share

Update: As per the solution below, @Dareon also works for Xcode Version 8.3 (8E162) and 8.3.2 (8E2002). Thanks @Dareon for confirming. :)

I ran into the same problem and after that worked for me.

I am using Xcode Version 8.2.1 (8C1002).

  • Go to Xcode> Preferences> Text Editing
  • Upon completion of the code - Uncheck the box "Suggest completion upon entry"
  • Exit Xcode and then restart Xcode.
  • Go to Xcode> Preferences> Edit Text again
  • Exit Xcode and then restart Xcode.
  • Now go to code completion and check . Suggest completion when typing '.
  • Try entering a library function or enum and enjoy!

At least it worked for me.

+142
Feb 22 '17 at 0:22
source share

Just restarting Xcode worked for me.

+4
Mar 29 '17 at 12:53 on
source share

I had serious problems with this. For me, code completion and formatting is lost in the current working source file when I ever do compilation. If I go back and go to another tab and go back, after a second or two it will start working again. Sometimes even this does not work, and I have to stay on one tab and open another file, and then move back.

Even those methods do not work if I leave Xcode open and force the computer to sleep for several hours and return. When this happens, I need to exit Xcode, sometimes Force Quit it, and then after you return, follow the steps above. But I had to deal with it after each compilation or compilation and launch. I have not tried 8.3 beta yet.

+1
Jan 25 '17 at 4:19 on
source share

Just clean and create the application once on the Generic iOS Device , perhaps this is due to some compile-time problem that disables intelligence. I see this error with Xcode 8.2.1.

+1
Aug 29 '17 at 7:02 on
source share

I had the same problem when “indexing” didn't work. Since I used pod and static libraries. I just rebuilt the static libraries separately.

Hope this helps.

0
Jul 03 '17 at 11:36 on
source share

If you have large static literals, try commenting on them. Sometimes they can disable the compiler.

0
Sep 25 '17 at 19:10
source share



All Articles