Skip to content

rustdoc: include item type in search results #93496

Closed

Description

@jsha

There are a fair number of items that have the same name but different types. For instance, std::panic (the macro) and std::panic (the module). Right now we distinguish these with colors. But that's not accessible for colorblind people. Also some of the colors are not often seen in a context where someone is likely to learn what they mean - for instance green for macros.

We should additionally distinguish search results by writing the actually type of the item. This should probably be its own column, between the item name and the description.

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    A-rustdoc-uiArea: Rustdoc UI (generated HTML)
    on Jan 31, 2022
  2. GuillaumeGomez commented on Jan 31, 2022

    @GuillaumeGomez
    Member

    Why not putting it before the name every time instead of putting it in its own column?

  3. jsha commented on Jan 31, 2022

    @jsha
    ContributorAuthor
  4. GuillaumeGomez commented on Jan 31, 2022

    @GuillaumeGomez
    Member

    Then name (type)?

  5. jaskij commented on Mar 25, 2022

    @jaskij

    Maybe just the first letter even? Stylized differently, or as an icon, so that it stands out more.

    Edit to add: My point is, to have the type stand out visually as not a part of the result name and path. Different color, different font, something.

  6. fmease commented on Aug 12, 2022

    @fmease
    Member

    For prior art, take a look at the doc pages of Scala 2 and 3. They use circles containing the initial letter of the item type.

  7. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    on Sep 6, 2023
  8. fmease commented on Sep 7, 2023

    @fmease
    Member

    Fixed by #110688.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-searchArea: Rustdoc's search featureA-rustdoc-uiArea: Rustdoc UI (generated HTML)C-enhancementCategory: An issue proposing an enhancement or a PR with one.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