Xcode Command-Slash Shortcut to Comment Only Works Sometimes Xcode Command-Slash Shortcut to Comment Only Works Sometimes xcode xcode

Xcode Command-Slash Shortcut to Comment Only Works Sometimes


For an Xcode 8, solution is

sudo /usr/libexec/xpccachectl

and restart your computer.


Hit +] once and then +/ will start working again.

You can hit +[ to undo the indentation effect.

Update:

Please note- This solution was provided prior to Xcode 8 launch so it may not work for everyone. If you are still facing problem, kindly refer to @CryingHippo's answer instead of downvoting.


I have done this numerous times with Xcode 8. Latest being Xcode 10.1 where I would just quit Xcode and go to Applications and rename Xcode to something else, e.g. Xcode 2, launch it, quit again and rename back. It starts working after that. No Mac restart or Terminal commands required.

It still works as of Xcode 10.1. I cannot believe Apple still hasn't fixed it properly.