Tried adding a prose to my Playground on Mac, ran the code, Playground crashed, and now my Playground file won't open.

I was building from the Puzzle World template. I wanted to add a prose above my code so I used //: it crashed Playground. I tried /*: as it was multiple lines and it also crashed. I decided to click the little plus sign next to pages, to add a new page and tried writing a prose there. The app crashed now my playground file won't open. When I double click to open my playground, it gives me the error: "Error parsing source tags: Improperly nested tag: editable-code." Is there anyway I can recover my code? it's my only copy. Duplicating the playground file results in the same error.

Replies

If you care to try something ...


In the Finder, use the 'Go To' menu for ~/Library/Preferences (the Libary folder in your user's directory) and find any plists with Xcode in their name - I'd expect at least these two:


com.apple.Xcode.plist.lockfile

com.apple.Xcode.plist


..and more, perhaps as many as 9 total.


With Xcode not running, delete all of them, empty the trash, then try opening Xcode again by double-clicking in the Finder.


>gives me the error: "Error parsing source tags: Improperly nested tag: editable-code." Duplicating the playground file results in the same error.


Stop 'duplicating'.


See https://developer.apple.com/documentation/swift_playgrounds/specifying_editable_regions_in_a_playground_page?language=objc


And be sure to start using a backup of your projects/playgrounds as a rule.