summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/externs.js
AgeCommit message (Collapse)AuthorLines
2023-09-03rustdoc: bug fix for `-> option<t>`Michael Howell-0/+1
2023-09-03rustdoc-search: add support for type parametersMichael Howell-2/+49
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-03rustdoc-search: `null`, not `-1`, for missing idMichael Howell-1/+1
This allows us to use negative numbers for others purposes.
2023-06-11rustdoc-search: build args, return, and generics on one unifierMichael Howell-2/+2
This enhances generics with the "unboxing" behavior where A<T> matches T. It makes this unboxing transitive over generics.
2023-04-17rustdoc: restructure type search engine to pick-and-use IDsMichael Howell-1/+4
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-13rustdoc-search: use ES6 Map for `Result` instead of ObjectMichael Howell-1/+6
2022-06-27Add comments, fixes for `0` sentinelMichael Howell-0/+6
2022-06-27Update src/librustdoc/html/static/js/externs.jsMichael Howell-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-06-27Add documentationMichael Howell-0/+53
2022-05-07Change eslint rules from configuration comments to configuration filesFolyd-3/+0
2022-04-26Migrate externs.js to ES6Guillaume Gomez-7/+10
2022-04-18Apply suggestions:Guillaume Gomez-1/+0
* Forbid generics without a path (so "<p>" is forbidden). * Change `handleSingleArg` so that it takes `results_others`, `results_in_args` and `results_returned` as arguments instead of using the "global" variables. * Change `createQueryElement` so that it returns the newly created element instead of taking `elems` as argument. * Improve documentation
2022-04-18* Greatly improve the rustdoc search parser source codeGuillaume Gomez-6/+38
* Move all functions outside parseQuery
2022-04-18Improve naming of "val" fieldGuillaume Gomez-1/+1
2022-04-18Greatly improve rustdoc searchGuillaume Gomez-4/+24
2021-12-22Add some JSDoc comments to rustdoc JSJacob Hoffman-Andrews-0/+32
This follows the Closure Compiler dialect of JSDoc, so we can use it to do some basic type checking. We don't plan to compile with Closure Compiler, just use it to check types. See https://github.com/google/closure-compiler/wiki/ for details.