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

Rustdoc cross-crate search should list items from the current crate first #13178

Closed
huonw opened this issue Mar 28, 2014 · 0 comments
Closed
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@huonw
Copy link
Member

huonw commented Mar 28, 2014

Things from other crates can be explicitly divided off, e.g. inside std, searching for repr is currently hard to interpret, but could look like

  • std::repr
  • std::raw::Repr::repr
  • std::raw::Repr
  • std::repr::Repr
  • std::repr::repr_to_str
  • std::repr::ReprVisitor

Other crates

  • rustc::middle::trans::adt::Repr
  • rustc::middle::borrowck::RestrictionSet::repr
  • ...

This is especially important with large crates like rustc and syntax being included, which are full of unnecessarily exported things, and are rarely what users want.

(@cmr and @chrismorgan: I saw you discussing this on IRC, but I don't think either of you filed a bug, close as a dupe if you did.)

lifthrasiir added a commit to lifthrasiir/rust that referenced this issue Apr 14, 2014
This essentially rewrites the sorting algorithm, which relied on
the implementation-defined handling of non-consistent sorting function
(cf. ECMA-262 5th edition, section 15.4.4.11)
and was also a bit inefficient.

The new criteria expands the prior criteria while adding these ones:

- The current crate is always preferred over other crates.
  (Closes rust-lang#13178)
- An item with a description is preferred over one without it,
  if item names match. This is a heuristic assuming that
  the documented item is more likely to be relevant.
- An item with no literal occurrence of search query is handled correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant