It's pretty rough at the moment, but I had a little time to throw together a prototype of what a swift-doc
might look like (repo @ GitHub - owenv/swift-doc: Experimental Swift tool for doc generation via symbol graph dumps). It's powered by the new swift-symbolgraph-extract
tool which can read all of the information needed for docs directly from a serialized module. Right now, it's possible to type swift doc RangeReplaceableCollection
and get:
[Protocol] RangeReplaceableCollection
• Conforms to Collection
• Conforms to Sequence
======================
A collection that supports replacement of an arbitrary subrange of elements
with the elements of another collection.
...
...
...
The output format of swift-symbolgraph-extract
isn't stable yet so this is kind of fragile at the moment, but I think it could eventually be a pretty good solution to the problem of documentation queries.