Skip to content
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

Open
1 of 7 tasks
GuillaumeGomez opened this issue Sep 19, 2021 · 2 comments
Open
1 of 7 tasks

Tracking Issue for "jump to definition" #89095

GuillaumeGomez opened this issue Sep 19, 2021 · 2 comments
Assignees
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Sep 19, 2021

Here what are the remaining things to be done:

Steps

To go through stabilization, we will gradually enable it in different places:

Implementation history

  1. The initial PR which added the links to definition in the source code pages: Generate links to definition in rustdoc source code pages #84176
  2. Add links for primitives in "jump to definition" feature: Add links for primitives in "jump to definition" feature #88033
  3. Add links for primitives: Add macro support in jump to definition feature #91264
@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. A-rustdoc-ui Area: rustdoc UI (generated HTML) labels Sep 19, 2021
@GuillaumeGomez GuillaumeGomez self-assigned this Sep 19, 2021
@jyn514
Copy link
Member

jyn514 commented Sep 24, 2021

Enable the feature by default (on nightly only) and reverse the flag (so that it disables instead of enabling).

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.

@GuillaumeGomez
Copy link
Member Author

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.

Manishearth added a commit to Manishearth/rust that referenced this issue Sep 24, 2021
…-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`
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Sep 24, 2021
…-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``
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Aug 18, 2024
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 <guillaume1.gomez@gmail.com>
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 <ojeda@kernel.org>
ojeda added a commit to ojeda/linux that referenced this issue Aug 25, 2024
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 <guillaume1.gomez@gmail.com>
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 <gary@garyguo.net>
Link: https://lore.kernel.org/r/20240818141249.387166-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants