summary refs log tree commit diff
path: root/tests/rustdoc-js
AgeCommit message (Collapse)AuthorLines
2023-09-09rustdoc-search: fix bugs when unboxing and reordering combineMichael Howell-0/+75
2023-09-03rustdoc: fix test case for generics that look like namesMichael Howell-2/+6
2023-09-03rustdoc-search: add support for type parametersMichael Howell-0/+102
When writing a type-driven search query in rustdoc, specifically one with more than one query element, non-existent types become generic parameters instead of auto-correcting (which is currently only done for single-element queries) or giving no result. You can also force a generic type parameter by writing `generic:T` (and can force it to not use a generic type parameter with something like `struct:T` or whatever, though if this happens it means the thing you're looking for doesn't exist and will give you no results). There is no syntax provided for specifying type constraints for generic type parameters. When you have a generic type parameter in a search query, it will only match up with generic type parameters in the actual function, not concrete types that match, not concrete types that implement a trait. It also strictly matches based on when they're the same or different, so `option<T>, option<U> -> option<U>` matches `Option::and`, but not `Option::or`. Similarly, `option<T>, option<T> -> option<T>`` matches `Option::or`, but not `Option::and`.
2023-09-02Correctly handle paths from foreign itemsGuillaume Gomez-0/+19
2023-09-01Add tests for type-based searchGuillaume Gomez-0/+41
2023-06-15Auto merge of #112233 - notriddle:notriddle/search-unify, r=GuillaumeGomezbors-0/+181
rustdoc-search: clean up type unification and "unboxing" This PR redesigns parameter matching, return matching, and generics matching to use a single function that compares two lists of types. It also makes the algorithms more consistent, so the "unboxing" behavior where `Vec<i32>` is considered a match for `i32` works inside generics, and not just at the top level.
2023-06-12rustdoc-search: search never type with `!`Michael Howell-0/+59
This feature extends rustdoc to support the syntax that most users will naturally attempt to use to search for diverging functions. Part of #60485 It's already possible to do this search with `primitive:never`, but that's not what the Rust language itself uses, so nobody will try it if they aren't told or helped along.
2023-06-11rustdoc-search: fix order-independence bugMichael Howell-0/+108
2023-06-11rustdoc-search: build args, return, and generics on one unifierMichael Howell-0/+73
This enhances generics with the "unboxing" behavior where A<T> matches T. It makes this unboxing transitive over generics.
2023-06-10rustdoc: add note about slice/array searches to help popupMichael Howell-1/+1
2023-06-10rustdoc: search for slices and arrays by type with `[]`Michael Howell-0/+21
Part of #60485
2023-06-09Update rustdoc-js* formatGuillaume Gomez-216/+104
2023-05-06Rollup merge of #110780 - notriddle:notriddle/slice-index, r=GuillaumeGomezYuki Okushi-0/+81
rustdoc-search: add slices and arrays to index This indexes them as primitives with generics, so `slice<u32>` is how you search for `[u32]`, and `array<u32>` for `[u32; 1]`. A future commit will desugar the square bracket syntax to search both arrays and slices at once.
2023-04-24rustdoc-search: add slices and arrays to indexMichael Howell-0/+81
This indexes them as primitives with generics, so `slice<u32>` is how you search for `[u32]`, and `array<u32>` for `[u32; 1]`. A future commit will desugar the square bracket syntax to search both arrays and slices at once.
2023-04-17rustdoc: restructure type search engine to pick-and-use IDsMichael Howell-0/+27
This change makes it so, instead of mixing string distance with type unification, function signature search works by mapping names to IDs at the start, reporting to the user any cases where it had to make corrections, and then matches with IDs when going through the items. This only changes function searches. Name searches are left alone, and corrections are only done when there's a single item in the search query.
2023-04-14rustdoc-search: add support for nested genericsMichael Howell-0/+52
2023-03-20rustdoc: add support for type filters in arguments and genericsMichael Howell-0/+39
This makes sense, since the search index has the information in it, and it's more useful for function signature searches since a function signature search's item type is, by definition, some type of function (there's more than one, but not very many).
2023-03-19rustdoc: implement bag semantics for function parameter searchMichael Howell-0/+24
This tweak to the function signature search engine makes things so that, if a type is repeated in the search query, it'll only match if the function actually includes it that many times.
2023-03-07rustdoc: fix type search when more than one `where` clause appliesMichael Howell-1/+15
2023-03-07rustdoc: fix type search index for `fn<T>() -> &T where T: Trait`Michael Howell-1/+12
2023-03-04rustdoc: function signature search with traits in `where` clauseMichael Howell-0/+35
2023-02-16rustdoc: search by macro when query ends with `!`Michael Howell-0/+20
Related to #96399
2023-01-21rustdoc: update test cases to match with stricter match criteriaMichael Howell-1/+0
2023-01-21rustdoc: compute maximum Levenshtein distance based on the queryMichael Howell-2/+0
The heuristic is pretty close to the name resolver. Fixes #103357
2023-01-14rustdoc: update search test casesMichael Howell-2/+1
2023-01-11Move /src/test to /testsAlbert Larsan-0/+1300