forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#14662 - Ddystopia:open_locally_built_document…
…atin_instead_of_docs_dot_rs, r=Ddystopia Provide links to locally built documentation for `experimental/externalDocs` This pull request addresses issue rust-lang#12867, which requested the ability to provide links to locally built documentation when using the "Open docs for symbol" feature. Previously, rust-analyzer always used docs.rs for this purpose. With these changes, the feature will provide both web (docs.rs) and local documentation links without verifying their existence. Changes in this PR: - Added support for local documentation links alongside web documentation links. - Added `target_dir` path argument for external_docs and other related methods. - Added `sysroot` argument for external_docs. - Added `target_directory` path to `CargoWorkspace`. API Changes: - Added an experimental client capability `{ "localDocs": boolean }`. If this capability is set, the `Open External Documentation` request returned from the server will include both web and local documentation links in the `ExternalDocsResponse` object. Here's the `ExternalDocsResponse` interface: ```typescript interface ExternalDocsResponse { web?: string; local?: string; } ``` By providing links to both web-based and locally built documentation, this update improves the developer experience for those using different versions of crates, git dependencies, or local crates not available on docs.rs. Rust-analyzer will now provide both web (docs.rs) and local documentation links, leaving it to the client to open the desired link. Please note that this update does not perform any checks to ensure the validity of the provided links.
- Loading branch information
Showing
8 changed files
with
307 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.