1
Fork 0

Fix deduplication of items

This commit is contained in:
Guillaume Gomez 2017-12-01 20:55:25 +01:00
parent 6805b016ef
commit 30734c4e68

View file

@ -720,6 +720,13 @@
return false;
}
function generateId(ty) {
if (ty.parent && ty.parent.name) {
return itemTypes[ty.ty] + ty.path + ty.parent.name + ty.name;
}
return itemTypes[ty.ty] + ty.path + ty.name;
}
// quoted values mean literal search
var nSearchWords = searchWords.length;
if ((val.charAt(0) === "\"" || val.charAt(0) === "'") &&
@ -730,7 +737,7 @@
var in_args = findArg(searchIndex[i], val, true);
var returned = checkReturned(searchIndex[i], val, true);
var ty = searchIndex[i];
var fullId = itemTypes[ty.ty] + ty.path + ty.name;
var fullId = generateId(ty);
if (searchWords[i] === val.name) {
// filter type: ... queries
@ -786,7 +793,7 @@
if (!type) {
continue;
}
var fullId = itemTypes[ty.ty] + ty.path + ty.name;
var fullId = generateId(ty);
// allow searching for void (no output) functions as well
var typeOutput = type.output ? type.output.name : "";
@ -872,7 +879,7 @@
var index = -1;
// we want lev results to go lower than others
var lev = MAX_LEV_DISTANCE + 1;
var fullId = itemTypes[ty.ty] + ty.path + ty.name;
var fullId = generateId(ty);
if (searchWords[j].indexOf(split[i]) > -1 ||
searchWords[j].indexOf(val) > -1 ||