Rollup merge of #86746 - GuillaumeGomez:query-type-filter, r=notriddle
Fix rustdoc query type filter I realized while reviewing #86659 that the type filter was broken on search so I'd prefer it to get merged before merging #86659. r? `@notriddle`
This commit is contained in:
commit
f458d8f669
2 changed files with 14 additions and 1 deletions
|
@ -801,7 +801,8 @@ window.initSearch = function(rawSearchIndex) {
|
||||||
results_returned[fullId].lev =
|
results_returned[fullId].lev =
|
||||||
Math.min(results_returned[fullId].lev, returned);
|
Math.min(results_returned[fullId].lev, returned);
|
||||||
}
|
}
|
||||||
if (index !== -1 || lev <= MAX_LEV_DISTANCE) {
|
if (typePassesFilter(typeFilter, ty.ty) &&
|
||||||
|
(index !== -1 || lev <= MAX_LEV_DISTANCE)) {
|
||||||
if (index !== -1 && paths.length < 2) {
|
if (index !== -1 && paths.length < 2) {
|
||||||
lev = 0;
|
lev = 0;
|
||||||
}
|
}
|
||||||
|
|
12
src/test/rustdoc-js-std/typed-query.js
Normal file
12
src/test/rustdoc-js-std/typed-query.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
// exact-check
|
||||||
|
|
||||||
|
const QUERY = 'macro:print';
|
||||||
|
|
||||||
|
const EXPECTED = {
|
||||||
|
'others': [
|
||||||
|
{ 'path': 'std', 'name': 'print' },
|
||||||
|
{ 'path': 'std', 'name': 'eprint' },
|
||||||
|
{ 'path': 'std', 'name': 'println' },
|
||||||
|
{ 'path': 'std', 'name': 'eprintln' },
|
||||||
|
],
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue