-
Notifications
You must be signed in to change notification settings - Fork 13k
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] Various issues with search tabs #45608
Comments
This is the original issue I was going to post about. When searching, functions whose name is the same as its return type are not shown. For example, the zip method of the iterator trait returns a struct called Zip. When you search for "zip" in the search bar, the zip function is absent from the default "Types/modules" tab of the results: It only appears in the "As return value" tab: I think the correct behavior should be the function appearing in both places. I had a look at the source, and I believe the problem is here: if (results['others'].length < maxResults && ((query.search && obj.name.indexOf(query.search)) || added === false))
{
results['others'].push(obj);
} Adding if (results['others'].length < maxResults && ((query.search && obj.name.indexOf(query.search) != -1) || added === false))
{
results['others'].push(obj);
} I don't understand the code very well though. |
Oh nice, thanks for the feedback! I'll fix it today. |
Search fixes Fixes #45608. r? @QuietMisdreavus
Great work! The last point hasn't been addressed though. I think something like "In name" would be a better label. Thoughts? |
No clue... Might be worth opening a new issue so we can discuss about it. |
Ok, opened #45787. |
Thanks! |
I've come across several issues related to the search tabs:
std::thread::current
has signaturepub fn current() -> Thread
, yet doesn't show up in the "As return value" tab when searching for "Thread".I think the first tab shouldn't be labeled "Types/modules", as it also shows functions and macros.(moved to separate issue [rustdoc] Improve "Types/modules" label on the search results page #45787)Link to the recent pull request implementing the search tabs
cc @GuillaumeGomez
The text was updated successfully, but these errors were encountered: