Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No Code Completion or Syntax Highlighting in Xcode Unit Test Target with "Defined Module" enabled

We have a project with a Unit Test target that has "Defines Module" enabled, due to a mix of Objective C and Swift. With that setting enabled, syntax highlighting and code completion stops for all non-language items. IE code completion will list language level stuff like NS_ENUM and for loop, but not NSString and not any of our classes.

The same thing happens if I create a new project, set "Defines Module" to YES. Syntax Highlighting and Code Completion fails in the Unit Test Code, set it to NO it starts working again.

We have tried all the usual ways to get things to work, Deleting "Derived Data", Checking/Unchecking "Suggest Completions While typing" and "Enable type-over Completions", deleting "~/Library/Caches/com.apple.dt.Xcode", deleting items in var/folders/, adding some clean up scripts to the post build phase, setting the main target to "Defines Module" as well, and of course endless restarts of Xcode and macOS.

I have repo'd this on 3 different Macs (Sierra) with Xcode 8.3.2 and Xcode 8.2. I have one team member that is not having this issue and the only real difference seems to be that he's still on El Cap.

Here is a list of some of the things we've tried:

Xcode 8 syntax highlighting doesn't work

How to Empty Caches and Clean All Targets Xcode 4

Xcode 8.2 Code Completion Not Working

One Weird Trick to Fix Autocomplete in Xcode

Apple Dev Forums

Has anybody had luck with getting this to work (other than turning off "Defines Module" in the Test Target)? My next step is to file a Radar.

like image 818
TheGeoff Avatar asked May 05 '17 18:05

TheGeoff


1 Answers

Looks like you have arm64 in your Debug configuration for Valid Architectures. May be because of that you are getting this error. Try removing arm64 on your valid architecture inside debug configuration and try building it.

like image 133
Hussain Shabbir Avatar answered Sep 18 '22 23:09

Hussain Shabbir