File tree 3 files changed +25
-2
lines changed
3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 160
160
// used for special search precedence
161
161
var TY_PRIMITIVE = itemTypes . indexOf ( "primitive" ) ;
162
162
var TY_KEYWORD = itemTypes . indexOf ( "keyword" ) ;
163
+ var TY_MACRO = itemTypes . indexOf ( "macro" ) ;
163
164
164
165
onEach ( document . getElementsByClassName ( 'js-only' ) , function ( e ) {
165
166
removeClass ( e , 'js-only' ) ;
465
466
var res = buildHrefAndPath ( obj ) ;
466
467
obj . displayPath = pathSplitter ( res [ 0 ] ) ;
467
468
obj . fullPath = obj . displayPath + obj . name ;
469
+ // To be sure than it some items aren't considered as duplicate.
468
470
if ( obj . ty === TY_KEYWORD ) {
469
- // To be sure than it isn't considered as duplicate with items.
470
471
obj . fullPath += '|k' ;
472
+ } else if ( obj . ty === TY_MACRO ) {
473
+ obj . fullPath += '|m' ;
471
474
}
472
475
obj . href = res [ 1 ] ;
473
476
out . push ( obj ) ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // ignore-order
12
+
13
+ const QUERY = 'panic' ;
14
+
15
+ const EXPECTED = {
16
+ 'others' : [
17
+ { 'path' : 'std' , 'name' : 'panic' , ty : 14 } , // 15 is for macros
18
+ { 'path' : 'std' , 'name' : 'panic' , ty : 0 } , // 0 is for modules
19
+ ] ,
20
+ } ;
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ function main(argv) {
233
233
234
234
var arraysToLoad = [ "itemTypes" ] ;
235
235
var variablesToLoad = [ "MAX_LEV_DISTANCE" , "MAX_RESULTS" ,
236
- "TY_PRIMITIVE" , "TY_KEYWORD" ,
236
+ "TY_PRIMITIVE" , "TY_KEYWORD" , "TY_MACRO" ,
237
237
"levenshtein_row2" ] ;
238
238
// execQuery first parameter is built in getQuery (which takes in the search input).
239
239
// execQuery last parameter is built in buildIndex.
You can’t perform that action at this time.
0 commit comments