mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
28f17d97a9
The search sorting code already sorts by item type discriminant, putting things with smaller discriminants first. There was also a special case for sorting keywords and primitives earlier, and this commit removes it by giving them lower discriminants. The sorting code has another criteria where items with descriptions appear earlier than items without, and that criteria has higher priority than the item type. This shouldn't matter, though, because primitives and keywords normally only appear in the standard library, and it always gives them descriptions.
98 lines
2.2 KiB
JavaScript
98 lines
2.2 KiB
JavaScript
const PARSED = [
|
|
{
|
|
query: "-> F<P>",
|
|
elems: [],
|
|
foundElems: 1,
|
|
original: "-> F<P>",
|
|
returned: [{
|
|
name: "f",
|
|
fullPath: ["f"],
|
|
pathWithoutLast: [],
|
|
pathLast: "f",
|
|
generics: [
|
|
{
|
|
name: "p",
|
|
fullPath: ["p"],
|
|
pathWithoutLast: [],
|
|
pathLast: "p",
|
|
generics: [],
|
|
},
|
|
],
|
|
typeFilter: -1,
|
|
}],
|
|
userQuery: "-> f<p>",
|
|
error: null,
|
|
},
|
|
{
|
|
query: "-> P",
|
|
elems: [],
|
|
foundElems: 1,
|
|
original: "-> P",
|
|
returned: [{
|
|
name: "p",
|
|
fullPath: ["p"],
|
|
pathWithoutLast: [],
|
|
pathLast: "p",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
}],
|
|
userQuery: "-> p",
|
|
error: null,
|
|
},
|
|
{
|
|
query: "->,a",
|
|
elems: [],
|
|
foundElems: 1,
|
|
original: "->,a",
|
|
returned: [{
|
|
name: "a",
|
|
fullPath: ["a"],
|
|
pathWithoutLast: [],
|
|
pathLast: "a",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
}],
|
|
userQuery: "->,a",
|
|
error: null,
|
|
},
|
|
{
|
|
query: "aaaaa->a",
|
|
elems: [{
|
|
name: "aaaaa",
|
|
fullPath: ["aaaaa"],
|
|
pathWithoutLast: [],
|
|
pathLast: "aaaaa",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
}],
|
|
foundElems: 2,
|
|
original: "aaaaa->a",
|
|
returned: [{
|
|
name: "a",
|
|
fullPath: ["a"],
|
|
pathWithoutLast: [],
|
|
pathLast: "a",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
}],
|
|
userQuery: "aaaaa->a",
|
|
error: null,
|
|
},
|
|
{
|
|
query: "-> !",
|
|
elems: [],
|
|
foundElems: 1,
|
|
original: "-> !",
|
|
returned: [{
|
|
name: "never",
|
|
fullPath: ["never"],
|
|
pathWithoutLast: [],
|
|
pathLast: "never",
|
|
generics: [],
|
|
typeFilter: 1,
|
|
}],
|
|
userQuery: "-> !",
|
|
error: null,
|
|
},
|
|
];
|