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 search should use fuzzy searching in Return Type tab #81646

Closed
HeroicKatora opened this issue Feb 1, 2021 · 2 comments
Closed

Rustdoc search should use fuzzy searching in Return Type tab #81646

HeroicKatora opened this issue Feb 1, 2021 · 2 comments
Labels
A-rustdoc-search Area: Rustdoc's search feature C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@HeroicKatora
Copy link
Contributor

HeroicKatora commented Feb 1, 2021

Methods are only shown in 'In Return Type' results when their return types match the named type exactly. This is confusing as the normal search also works with any prefix and there is no indication that the other, similar looking tabs, would be stricter in their matching criteria. The title of course adds to the confusion as it directly suggests that fragments are considered.

For example:

https://docs.rs/wgpu/0.7.0/wgpu/struct.Device.html?search=CommandEncode#method.create_command_encoder

I expected to see this happen: The Device::create_command_encoder method should show up in the In Return Type search results. Note that when the name is completed to CommandEncoder the result is as expected:

Screen Shot 2021-02-01 at 22 08 40

Instead, this happened: There are two results in names, and no results for parameters or return types.

Screen Shot 2021-02-01 at 22 06 58

@HeroicKatora HeroicKatora added the C-bug Category: This is a bug. label Feb 1, 2021
@jonas-schievink jonas-schievink added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 1, 2021
@HeroicKatora
Copy link
Contributor Author

This is probably connected to another false negative with rather large detriments to discoverability of an API. Consider a type that only occur as part of a -> impl return type, as part of its bindings, such as -> impl Iterator<Item=Foo>. Then the method returning such an anonymous type can never be discovered through the search. One example is wgpu::Queue. It has a single way of construction, which returns an impl-Future.

Screen Shot 2021-02-01 at 22 18 40
Screen Shot 2021-02-01 at 22 18 58

Since there are no apparent methods constructing it, via search, one is left quite puzzled as to how one is supposed to ever create an instance ;) If it's a separate issue then feel free to fork or ping me.

@jyn514 jyn514 added the A-rustdoc-search Area: Rustdoc's search feature label Feb 2, 2021
@jyn514 jyn514 changed the title Rustdoc search does not consider prefix for Return Type search Rustdoc search should use fuzzy searching in Return Type tab Feb 2, 2021
@notriddle
Copy link
Contributor

Fixed by #110371

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-search Area: Rustdoc's search feature C-bug Category: This is a bug. 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

5 participants