Skip to content

rustdoc: make trait methods findable with Ctrl-F #85923

Closed

Description

When looking at a struct or enum page, it's common to look for a method with Ctrl-F. This works if the method is part of an inherent implementation (that is, a method on the struct or enum itself). But if the method is part of a trait implementation, Ctrl-F won't find it because trait implementations are toggled closed by default.

I'm not sure of a great way to do this. Some ideas:

  • Listen for Ctrl-F and temporarily open the toggles. Problems: This is probably flaky; it doesn't work when selecting "Find in page" from a menu; we probably wouldn't get any sort of even to know when to close them again.
  • Implement our own in-page search, and override Ctrl-F. Personally I find it really unpleasant when pages do this; I think the browser functionality shouldn't be overridden.
  • Make the trait implementation toggles opened by default. I don't know the pros/cons on this; I assume they are closed by default for a good reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions