rustdoc: implement bag semantics for function parameter search
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.
This commit is contained in:
parent
8826b68c62
commit
5451fe7d7c
3 changed files with 94 additions and 26 deletions
20
tests/rustdoc-js/search-bag-semantics.js
Normal file
20
tests/rustdoc-js/search-bag-semantics.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
// exact-check
|
||||
|
||||
const QUERY = [
|
||||
'P',
|
||||
'P, P',
|
||||
];
|
||||
|
||||
const EXPECTED = [
|
||||
{
|
||||
'in_args': [
|
||||
{ 'path': 'search_bag_semantics', 'name': 'alacazam' },
|
||||
{ 'path': 'search_bag_semantics', 'name': 'abracadabra' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'others': [
|
||||
{ 'path': 'search_bag_semantics', 'name': 'abracadabra' },
|
||||
],
|
||||
},
|
||||
];
|
Loading…
Add table
Add a link
Reference in a new issue