vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

Add Swift Documentation Preview Support

Open Kyle-Ye opened this issue 2 years ago • 10 comments

Is your feature request related to a problem? Please describe.

When user actives documentation preview panel and is currently on a .swift, .h or .markdown file, preview the documentation on the right panel.

Describe the solution you'd like

It can be achieved by using the existing ConvertService API provided by DocC.

No Xcode magic is required.

https://twitter.com/franklinschrans/status/1666343700442628098

Benefits

Improve the doc-writing experience on non-Xcode IDE.

Additional context

Inspiration: Xcode 15's documentation preview feature

See more info https://developer.apple.com/videos/play/wwdc2023/10244/

Kyle-Ye avatar Jul 02 '23 15:07 Kyle-Ye

You can use the command Markdown: Open preview to the side to give a markdown preview. This won't give you the full docc preview obviously but it is a start.

adam-fowler avatar Aug 03 '23 10:08 adam-fowler

You can use the command Markdown: Open preview to the side to give a markdown preview. This won't give you the full docc preview obviously but it is a start.

Yeah. VSCode has a build-in Markdown preview panel.

But I'd like to know if it was possible to render a HTML directly in a associated-panel(The same as Markdown file and Markdown-Preview panel) via the VSCode plugin SDK.

Kyle-Ye avatar Aug 03 '23 12:08 Kyle-Ye

You can do it. But managing the preview server, associating the current page with the correct page on the server isn't simple. It is all possible, just complex.

I have looked into to it a bit and got it displaying a page served by preview server I was running separately. But it is far away from a finished feature.

adam-fowler avatar Aug 03 '23 13:08 adam-fowler

Any updates on this issue?

roydbt avatar Apr 01 '24 16:04 roydbt

No update on this. I haven't had anymore time to look into it.

adam-fowler avatar Apr 02 '24 05:04 adam-fowler

@adam-fowler Can we grab this one? If so, do you have your prototype changes in a fork somewhere?

daveyc123 avatar May 01 '24 17:05 daveyc123

@daveyc123 its all yours. I had some basic code setup to display the documentation but there was a loads of issues managing the preview server and updating the documentation. Don't think I kept any of the code around though.

adam-fowler avatar May 01 '24 19:05 adam-fowler

@daveyc123 I found this https://github.com/adam-fowler/vscode-swift/tree/documentation-preview

adam-fowler avatar May 02 '24 11:05 adam-fowler

Thanks for digging that up @adam-fowler

daveyc123 avatar May 02 '24 17:05 daveyc123

I just posted a general overview of how this feature could be implemented on the Swift forums: https://forums.swift.org/t/rfc-swift-docc-integration/75537

Please check it out and leave any feedback/suggestions that you might have!

matthewbastien avatar Oct 22 '24 18:10 matthewbastien