Snippets - status?

What happened to snippets? SE-0356 - it was implemented in Swift 5.7 but it has not been shipped with any Xcode version? So requires a nighlty toolchain?

Is there any update to its status that Ive missed?

I was very excited about snippets when they were initially pitched and Im looking forward to using them!

Thanks!

As of Swift 5.8 they were in there and usable, but only from command-line invocations of Docc, and with fairly non-existent inclusion in Xcode. So the core components are there and in the toolchain with (later) shipped versions of Swift, but they're not super easily accessible or well documented. There's a forum thread from 2022 that which is me poking at it and being confused about status, but in terms of earlier threads there's a decent one with details about using it from @TimTr : Using snippets with Swift-DocC - which most specifically highlights examples of using it in the swift-markdown repo.

Since Xcode 15 and 15.1 beta popped out, I haven't circled back to see if there's any further integration there - I didn't spot or hear of any in the release notes, but I was away for quite a few weeks and missed a bit, so there might be something there, but I'd recommend counting on needing to generate with CLI only at the moment.

2 Likes

could this be an XCode-only issue? i have been using snippets in VSCode since 5.7.

1 Like