Fix macro missing from doc search
This commit is contained in:
parent
a385095f9a
commit
afeb790ea1
|
@ -160,6 +160,7 @@
|
|||
// used for special search precedence
|
||||
var TY_PRIMITIVE = itemTypes.indexOf("primitive");
|
||||
var TY_KEYWORD = itemTypes.indexOf("keyword");
|
||||
var TY_MACRO = itemTypes.indexOf("macro");
|
||||
|
||||
onEach(document.getElementsByClassName('js-only'), function(e) {
|
||||
removeClass(e, 'js-only');
|
||||
|
@ -465,9 +466,11 @@
|
|||
var res = buildHrefAndPath(obj);
|
||||
obj.displayPath = pathSplitter(res[0]);
|
||||
obj.fullPath = obj.displayPath + obj.name;
|
||||
// To be sure than it some items aren't considered as duplicate.
|
||||
if (obj.ty === TY_KEYWORD) {
|
||||
// To be sure than it isn't considered as duplicate with items.
|
||||
obj.fullPath += '|k';
|
||||
} else if (obj.ty === TY_MACRO) {
|
||||
obj.fullPath += '|m';
|
||||
}
|
||||
obj.href = res[1];
|
||||
out.push(obj);
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-order
|
||||
|
||||
const QUERY = 'panic';
|
||||
|
||||
const EXPECTED = {
|
||||
'others': [
|
||||
{ 'path': 'std', 'name': 'panic', ty: 14 }, // 15 is for macros
|
||||
{ 'path': 'std', 'name': 'panic', ty: 0 }, // 0 is for modules
|
||||
],
|
||||
};
|
|
@ -233,7 +233,7 @@ function main(argv) {
|
|||
|
||||
var arraysToLoad = ["itemTypes"];
|
||||
var variablesToLoad = ["MAX_LEV_DISTANCE", "MAX_RESULTS",
|
||||
"TY_PRIMITIVE", "TY_KEYWORD",
|
||||
"TY_PRIMITIVE", "TY_KEYWORD", "TY_MACRO",
|
||||
"levenshtein_row2"];
|
||||
// execQuery first parameter is built in getQuery (which takes in the search input).
|
||||
// execQuery last parameter is built in buildIndex.
|
||||
|
|
Loading…
Reference in New Issue