Adding a comment after a case statement in an enum declaration can cause Xcode 9 Beta 4 to hang
| Originator: | aaron | ||
| Number: | rdar://33579553 | Date Originated: | 7/27/2017 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 9 Beta 4 |
| Classification: | Bug | Reproducible: | Always |
Summary:
The more characters I type after a comment on the same line as a case statement like this: // the more characters...
...causes SourceKitService to spin up to 200% CPU and then typing slows, beach balls happen, and then Xcode hangs.
Steps to Reproduce:
I have an enum like this:
enum ImageShape: String {
static let name = "shape"
case tall = "tall"
case thumb = "thumb"
case square = "square"
}
I was trying to type: // Crop gravity: north, ratio: 1:2.25 at the end of the line for case tall.
The farther along I get in typing those characters, the slower input to Xcode is received until the application hangs. If I leave that line before the comment gets too long, I can continue to use the application fine. If I return and add more text to that comment, Xcode goes back to hanging immediately on the first keystroke.
Expected Results:
Able to type comments anywhere in the code without hanging
Observed Results:
Xcode hangs.
Version:
Xcode 9, beta 4, OS X 10.12.6
Notes:
I can reproduce this in a Playground without any other impacting code. Playground and video showing the experience attached.
Comments
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!