about summary refs log tree commit diff
path: root/tests/rustdoc-js-std
AgeCommit message (Collapse)AuthorLines
2023-09-09rustdoc-search: fix bugs when unboxing and reordering combineMichael Howell-1/+26
2023-09-03rustdoc: bug fix for `-> option<t>`Michael Howell-0/+6
2023-09-03rustdoc-search: add support for type parametersMichael Howell-0/+53
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-01Add tests for type-based searchGuillaume Gomez-0/+7
2023-07-02Auto merge of #108537 - ↵bors-114/+251
GuillaumeGomez:rustdoc-search-whitespace-as-separator, r=notriddle rustdoc: Allow whitespace as path separator like double colon Fixes https://github.com/rust-lang/rust/issues/108447. I think it makes sense since it allows more common cases, however it also makes the syntax heavier. Not sure what the rest of the team thinks about it. In any case we'll need to go through FCP. Full explanation for the changes is available [here](https://github.com/rust-lang/rust/pull/108537#issuecomment-1589480564). r? `@notriddle`
2023-06-15Auto merge of #112233 - notriddle:notriddle/search-unify, r=GuillaumeGomezbors-0/+13
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-14Fix eBNF and handling of whitespace characters when not in a pathGuillaume Gomez-1/+105
2023-06-14Add "vec new" testGuillaume Gomez-9/+20
2023-06-14Update rustdoc-js-std testsGuillaume Gomez-105/+127
2023-06-12rustdoc-search: search never type with `!`Michael Howell-19/+98
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-4/+1
2023-06-11rustdoc-search: add test case for `bufread -> result<u8>`Michael Howell-0/+16
2023-06-10rustdoc: add note about slice/array searches to help popupMichael Howell-21/+17
2023-06-10rustdoc: search for slices and arrays by type with `[]`Michael Howell-0/+315
Part of #60485
2023-06-10rustdoc: add test case for `OsString::into_string`Michael Howell-0/+10
2023-06-09Update rustdoc-js* formatGuillaume Gomez-184/+132
2023-04-14rustdoc-search: add support for nested genericsMichael Howell-2/+122
2023-03-20rustdoc: add support for type filters in arguments and genericsMichael Howell-95/+142
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-16Rollup merge of #108875 - notriddle:notriddle/return-trait, r=GuillaumeGomezMatthias Krüger-6/+17
rustdoc: fix type search for `Option` combinators
2023-03-10rustdoc: use restricted Damerau-Levenshtein distance for searchMichael Howell-0/+12
Based on https://github.com/rust-lang/rust/pull/108200, for the same rationale. > This replaces the existing Levenshtein algorithm with the > Damerau-Levenshtein algorithm. This means that "ab" to "ba" is one change > (a transposition) instead of two (a deletion and insertion). More > specifically, this is a restricted implementation, in that "ca" to "abc" > cannot be performed as "ca" → "ac" → "abc", as there is an insertion in the > middle of a transposition. I believe that errors like that are sufficiently > rare that it's not worth taking into account. Before this change, searching `prinltn!` listed `print!` first, followed by `println!`. With this change, `println!` matches more closely.
2023-03-07rustdoc: fix type search when more than one `where` clause appliesMichael Howell-6/+17
2023-03-04Rollup merge of #108723 - notriddle:notriddle/where-clause, r=GuillaumeGomezMatthias Krüger-0/+7
rustdoc: function signature search with traits in `where` clause ## Before ![image](https://user-images.githubusercontent.com/1593513/222873534-a640a72a-c654-4702-9f3b-175129d9591d.png) ## After ![image](https://user-images.githubusercontent.com/1593513/222873544-fdfc431d-2b65-4b56-bede-0302ea9f153a.png)
2023-03-04rustdoc: function signature search with traits in `where` clauseMichael Howell-0/+7
2023-03-03Add test for unclosed genericGuillaume Gomez-0/+10
2023-03-02Add GUI test for rustdoc search errors backgroundGuillaume Gomez-2/+2
2023-03-01Rollup merge of #108143 - notriddle:notriddle/filter-exclamation-macro, ↵Dylan DPC-19/+88
r=GuillaumeGomez rustdoc: search by macro when query ends with `!` Related to #96399 Note: the `never` type alias is tested in [`/tests/rustdoc-js-std/alias-3.js`](https://github.com/notriddle/rust/blob/08ad401633037cc226b3806a3c5f48c2f34703bf/tests/rustdoc-js-std/alias-3.js) ## Before ![image](https://user-images.githubusercontent.com/1593513/219504192-54cc0753-ff97-4a37-ad4a-8ae915181325.png) ## After ![image](https://user-images.githubusercontent.com/1593513/219504251-589a7e11-1e7b-4b7b-879d-1b564080017c.png)
2023-02-16rustdoc: search by macro when query ends with `!`Michael Howell-19/+88
Related to #96399
2023-02-16rustdoc: hide `reference` methods in search indexMichael Howell-0/+8
2023-01-24rustdoc: add test case based on #103357Michael Howell-0/+10
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-3/+0
The heuristic is pretty close to the name resolver. Fixes #103357
2023-01-14rustdoc: update search test casesMichael Howell-4/+5
2023-01-11Move /src/test to /testsAlbert Larsan-0/+1549