What causes Playgrounds to break sometimes?

Here's the symptoms:

  • The line number column no longer glows blue for edits. It's always grey.
  • Clicking the play widget in the column does nothing. The only way to run is the play button on the bottom.
  • Typing an open brace then Enter to start a code block doesn't add the closing brace.
  • Closing then reopening, quitting then rerunning, or rebooting then running doesn't fix this.

Xcode 11 is installed from the Mac App store. Xcode going into non-functional fits during playgrounds has happened before; is there any way to fix this besides waiting and hoping?

Moving my types to separate files (within the playground) and removing all the extra comments, commented code, and #blocked code fixed it, somehow. So I'm stressing out some part of the playground support code that parses the files in real time, I guess.

If I had to guess, I’d say you’ve probably encountered the same bug that @Jens wrote about here.