26

I have seen many threads about this online, but not for Xcode 9. For some reason code completion and syntax highlighting is no longer working. Last week it was fine.

Using the GM build.

Anyone have this issue or know how to resolve it? A restart of Xcode and my computer did not help.

Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412

6 Answers6

34

In Finder I navigated to user->Library->Developer->Xcode->DerivedData and deleted the subfolder of the project in question. After next build of the project the syntax highlighting and code completion returned.

gpdawson
  • 713
  • 6
  • 15
7

In my situation, there are a few of .swift files not working. I've overcome by removing these files from project and re-adding them back.

azun
  • 391
  • 4
  • 11
5

Quitting Xcode then reopening it works for me.

C. Bess
  • 567
  • 7
  • 10
0

To make it work again, I have to restart the macOS System. I'm using Xcode 11.0 (11A420a), at the same time, Xcode 10 works OK. So I think there is some process does not work, which should work for code coloring.

DawnSong
  • 4,752
  • 2
  • 38
  • 38
0

For me, code completion/highlighting not working due to the missing file in the Compile Sources under Build Phases. I added that file and it works.

Hope this helps anyone.

enter image description here

iGW
  • 633
  • 5
  • 14
-2

I have observed the same problem while writing in swift on xcode 9.0, Seems it is fixed in 9.1 i am using 9.1 which is fine, please update xcode to 9.1 or newer.

Chandan
  • 500
  • 3
  • 10