-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for "jump to definition" #89095
Comments
I think we should not do this, this is exactly how we got in trouble with intra-doc links (see #63305). Instead we should just enable it by default at the same time we remove the flag and stabilize the feature. |
This is a very good point. I had in mind that maybe people would want to disable it but I guess we can always add it later on if the needs appear. |
…-rust-tools, r=jyn514 Enable "generate-link-to-definition" option on rust tools docs as well Just realized that we enable the option for the compiler crates, but we don't have it for rustdoc and the other tools documentation... Part of rust-lang#89095. cc `@rust-lang/rustdoc` r? `@Mark-Simulacrum`
…-rust-tools, r=jyn514 Enable "generate-link-to-definition" option on rust tools docs as well Just realized that we enable the option for the compiler crates, but we don't have it for rustdoc and the other tools documentation... Part of rust-lang#89095. cc ``@rust-lang/rustdoc`` r? ``@Mark-Simulacrum``
In Rust 1.56.0 [1], rustdoc introduced the "jump to definition" feature [2], i.e. the unstable flag `--generate-link-to-definition`. It adds links to the source view of the documentation. For instance, in the source view of `rust/kernel/sync.rs`, for this code: impl Default for LockClassKey { fn default() -> Self { Self::new() } } It will add three hyperlinks: - `Default` points to the rendered "Trait `core::default::Default`" page (not the source view, since it goes to another crate, though this may change). - `LockClassKey` points to the `pub struct LockClassKey(...);` line in the same page, highlighting the line number. - `Self::new()` points to the `pub const fn new() -> Self { ... }` associated function, highlighting its line numbers (i.e. for the full function). This makes the source view more useful and a bit closer to the experience in e.g. the Elixir Cross Referencer [3]. I have provisionally enabled it for rust.docs.kernel.org [4] -- one can take a look at the source view there for an example of how it looks like. Thus enable it. Cc: Guillaume Gomez <[email protected]> Link: rust-lang/rust#84176 [1] Link: rust-lang/rust#89095 [2] Link: https://elixir.bootlin.com [3] Link: https://rust.docs.kernel.org [4] Signed-off-by: Miguel Ojeda <[email protected]>
In Rust 1.56.0 [1], rustdoc introduced the "jump to definition" feature [2], i.e. the unstable flag `--generate-link-to-definition`. It adds links to the source view of the documentation. For instance, in the source view of `rust/kernel/sync.rs`, for this code: impl Default for LockClassKey { fn default() -> Self { Self::new() } } It will add three hyperlinks: - `Default` points to the rendered "Trait `core::default::Default`" page (not the source view, since it goes to another crate, though this may change). - `LockClassKey` points to the `pub struct LockClassKey(...);` line in the same page, highlighting the line number. - `Self::new()` points to the `pub const fn new() -> Self { ... }` associated function, highlighting its line numbers (i.e. for the full function). This makes the source view more useful and a bit closer to the experience in e.g. the Elixir Cross Referencer [3]. I have provisionally enabled it for rust.docs.kernel.org [4] -- one can take a look at the source view there for an example of how it looks like. Thus enable it. Cc: Guillaume Gomez <[email protected]> Link: rust-lang/rust#84176 [1] Link: rust-lang/rust#89095 [2] Link: https://elixir.bootlin.com [3] Link: https://rust.docs.kernel.org [4] Reviewed-by: Gary Guo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
Here what are the remaining things to be done:
Steps
To go through stabilization, we will gradually enable it in different places:
Implementation history
The text was updated successfully, but these errors were encountered: