From cd46ff6c052421277a7a3548b4fe40be4973feb1 Mon Sep 17 00:00:00 2001 From: binarycat Date: Sun, 3 Nov 2024 13:17:39 -0600 Subject: rustdoc search: allow queries to end in an empty path segment fixes https://github.com/rust-lang/rust/issues/129707 this can be used to show all items in a module, or all associated items for a type. currently sufferes slightly due to case insensitivity, so `Option::` will also show items in the `option::` module. it disables the checking of the last path element, otherwise only items with short names will be shown --- tests/rustdoc-js-std/path-end-empty.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/rustdoc-js-std/path-end-empty.js (limited to 'tests/rustdoc-js-std/path-end-empty.js') diff --git a/tests/rustdoc-js-std/path-end-empty.js b/tests/rustdoc-js-std/path-end-empty.js new file mode 100644 index 00000000000..6e853c61b4d --- /dev/null +++ b/tests/rustdoc-js-std/path-end-empty.js @@ -0,0 +1,6 @@ +const EXPECTED = { + 'query': 'Option::', + 'others': [ + { 'path': 'std::option::Option', 'name': 'get_or_insert_default' }, + ], +} -- cgit 1.4.1-3-g733a5