rust: add Open Documentation support
Check for existing issues
- [X] Completed
Describe the feature
in other editors i can select "Open Documentation" and it will open the docs.rs site for that item in the browser.
If applicable, add mockups / screenshots to help present your vision of the feature
No response
I believe this is rust-analyzer.openDocs
https://rust-analyzer.github.io/manual.html#open-docs
I've already written the code to support that feature, and I'll submit a PR later.
Not sure if this is possible, but could this eventually build and open local documentation sites for private crates which are not available on docs.rs?
Not sure if this is possible, but could this eventually build and open local documentation sites for private crates which are not available on docs.rs?
workspace.update(&mut cx, |_workspace, cx| {
// Check if the local document exists, otherwise fallback to the online document.
// Open with the default browser.
if let Some(local_url) = docs_urls.local {
if fs::metadata(Path::new(&local_url[8..])).is_ok() {
cx.open_url(&local_url);
return;
}
}
if let Some(web_url) = docs_urls.web {
cx.open_url(&web_url);
}
})
Rust-analyzer does provide this functionality. After generating the local documentation with cargo doc, you can use the open docs command to open the local documentation (including private crates). You can test this feature in VSCode, and it should meet your needs.
Awesome, thank you!
You’re welcome! I'm glad you liked it!
On Fri, Oct 18, 2024 at 3:33 PM Andrew Banchich @.***> wrote:
Awesome, thank you!
— Reply to this email directly, view it on GitHub https://github.com/zed-industries/zed/issues/18924#issuecomment-2421653976, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ABU2B462HJQ2YB2CKUCVTZ4C2S3AVCNFSM6AAAAABPU2YFH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRRGY2TGOJXGY . You are receiving this because you are subscribed to this thread.Message ID: @.***>