Xcode menu item Editor > Structure > Comment/Uncomment always disabled

Originator:bstahl
Number:rdar://27855179 Date Originated:2016-08-15
Status:open Resolved:
Product:Developer Tools Product Version:Xcode 8.0 beta 6 (8S201h)
Classification:UI/Usability Reproducible:always
 
Summary:
In Xcode 8 beta-6 (also the case in betas 4 & 5), the menu item to toggle comment/uncomment (Editor > Structure > Comment) of code lines is broken and will never be available. The corresponding keyboard shortcut (Cmd-/) does not work either.

Steps to Reproduce:
1. Place cursor in any line of code.
2. Try to use the menu item to comment or uncomment the line of code.
3. Nothing happens

Expected Results:
The line of code should be commented-out (if currently not commented), of uncommented (if currently commented).

Actual Results:
Nothing happens.

Version:
Xcode Version 8.0 beta 6 (8S201h)
OS X 10.11.6 "El Capitan"

Notes:
This is a function I literally use hundreds of times each day, so while it seems minor, this is actually a major problem and a productivity-killer, making it very difficult to use Xcode 8.

Have tested using Swift 2.3 code, and Objective-C code. Have also tested on 3 different computers, all running OS X 10.11.6: 2013 Mac Pro, 2012 MacBook Pro, 2011 MacBook Air. The Xcode comment/uncomment menu is disabled on all of them.

The Xcode beta-5 release notes state "The Editor’s Comment/Uncomment Selection command is functional when enabled. (27524523)". However, the issue was not fixed for me, and apparently for other people as well. See this discussion thread:
https://forums.developer.apple.com/thread/53339?start=0&tstart=0

Configuration:
Late 2013 Mac Pro
3 GHz, 8 core Intel Xeon E5
64 GB RAM
AMD FirePro D500 3GB
OS X 10.11.6 "El Capitan"

Comments

and still broken on Xcode 8.3.1 ...

Same issue here, with Xcode 8.2.1 on macOS 10.11

Appears to still be broken on the production version ... 8.0 (8A218a)

By cirrusflyer01 at Sept. 22, 2016, 1:22 p.m. (reply...)

This feature has been very unstable for a long time and in the past would just randomly stop working. I found in the past to fix the Cmd-/ key binding I could manually select the command from the Editor menu, which would seem to somehow reconnect the keyboard shortcut and it would work again (at least for a little while).

But as of Xcode 8 beta 6 things have gotten much worse, and now the menu items themselves are disabled, making the feature completely inaccessible. Like the poster says this is something I (and likely many others) use dozens of times per day. It's second nature to select a block of code and comment it out, and when it doesn't work the software feels VERY broken. This is a hugely important feature.

It is broken for all file types I've tested (Swift, Obj-C and XML). I really think you must have some fundamental implementation issues surrounding this feature because it's unreasonable how often it fails.

By chaiguy1337 at Aug. 25, 2016, 6:59 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!