Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSearch over generic types in docs #45673
Conversation
rust-highfive
assigned
QuietMisdreavus
Oct 31, 2017
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
kennytm
added
the
S-waiting-on-review
label
Nov 1, 2017
GuillaumeGomez
force-pushed the
GuillaumeGomez:rustdoc-type-search-generic
branch
3 times, most recently
from
fc2fb75
to
6f88227
Nov 1, 2017
This comment has been minimized.
This comment has been minimized.
GuillaumeGomez
changed the title
[WIP] Only search over generic types in docs
Only search over generic types in docs
Nov 3, 2017
GuillaumeGomez
changed the title
Only search over generic types in docs
Search over generic types in docs
Nov 3, 2017
This comment has been minimized.
This comment has been minimized.
|
Shouldn't some of these be in the "As return value" instead? I would expect the "As return value" tab to prioritize perfect matches of one of the type variables over ones that have no type variables but have a low lev score: For public perusal, i have a rendering of the current PR here. |
This comment has been minimized.
This comment has been minimized.
|
Now that #45617 is merged, can you rebase on top of it to factor out the commits that were taken from there? |
projektir
reviewed
Nov 7, 2017
| return b; | ||
| } | ||
|
|
||
| function nbElements(obj) { |
This comment has been minimized.
This comment has been minimized.
projektir
reviewed
Nov 7, 2017
| if (obj.generics && | ||
| obj.generics.length >= val.generics.length) { | ||
| var elems = obj.generics.slice(0); | ||
| for (var y = 0; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
projektir
reviewed
Nov 7, 2017
| if (obj && obj.type && obj.type.inputs.length > 0) { | ||
| for (var i = 0; i < obj.type.inputs.length; i++) { | ||
| if (obj.type.inputs[i].name === val) { | ||
| var tmp = checkType(obj.type.inputs[i], val, literalSearch); | ||
| if (literalSearch && tmp === true) { |
This comment has been minimized.
This comment has been minimized.
projektir
reviewed
Nov 7, 2017
|
|
||
| if (obj && obj.type && obj.type.output) { | ||
| var tmp = checkType(obj.type.output, val, literalSearch); | ||
| if (literalSearch && tmp === true) { |
This comment has been minimized.
This comment has been minimized.
shepmaster
added
S-waiting-on-author
and removed
S-waiting-on-review
labels
Nov 11, 2017
This comment has been minimized.
This comment has been minimized.
|
Ping from triage — @GuillaumeGomez will you be able to address some of the feedback you've received? |
This comment has been minimized.
This comment has been minimized.
|
I'll be able to address all of them. |
This comment has been minimized.
This comment has been minimized.
|
|
GuillaumeGomez
force-pushed the
GuillaumeGomez:rustdoc-type-search-generic
branch
from
597a82f
to
942a4e9
Nov 11, 2017
This comment has been minimized.
This comment has been minimized.
|
Updated. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Hum, still not good then... Let's see what's happening. |
This comment has been minimized.
This comment has been minimized.
|
Ok, the mystery has been solved: I forgot to add the results into the tab. We're good now. :) |
QuietMisdreavus
reviewed
Nov 12, 2017
|
Home stretch! With that last change, this totally works. Just one last nit and i'll be ready to call it good. |
| // FIXME: add all from clean::Type. | ||
| _ => None | ||
| } | ||
| } | ||
|
|
||
| fn get_generics(clean_type: &clean::Type) -> Option<Vec<String>> { | ||
| match *clean_type { | ||
| clean::ResolvedPath { ref path, .. } => { |
This comment has been minimized.
This comment has been minimized.
QuietMisdreavus
Nov 12, 2017
Member
Can't this just reuse Type::generics rather than copying it out? That way, if other Types support generics, both this and the "document impls when the type appears in the traits generics" benefit.
GuillaumeGomez
added some commits
Oct 31, 2017
GuillaumeGomez
added some commits
Nov 11, 2017
GuillaumeGomez
force-pushed the
GuillaumeGomez:rustdoc-type-search-generic
branch
from
2246728
to
0e4c829
Nov 12, 2017
This comment has been minimized.
This comment has been minimized.
|
Excellent! r=me pending travis. Thanks so much for doing this! This makes the extended search tabs much nicer. |
This comment has been minimized.
This comment has been minimized.
|
@bors: r=QuietMisdreavus |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Nov 13, 2017
This comment has been minimized.
This comment has been minimized.
|
|







GuillaumeGomez commentedOct 31, 2017
This is what I was talking about @QuietMisdreavus. Now we have generics.
Waiting for #45617 to get merged.