Fix deduplication of items
This commit is contained in:
parent
6805b016ef
commit
30734c4e68
1 changed files with 10 additions and 3 deletions
|
@ -720,6 +720,13 @@
|
||||||
return false;
|
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
|
// quoted values mean literal search
|
||||||
var nSearchWords = searchWords.length;
|
var nSearchWords = searchWords.length;
|
||||||
if ((val.charAt(0) === "\"" || val.charAt(0) === "'") &&
|
if ((val.charAt(0) === "\"" || val.charAt(0) === "'") &&
|
||||||
|
@ -730,7 +737,7 @@
|
||||||
var in_args = findArg(searchIndex[i], val, true);
|
var in_args = findArg(searchIndex[i], val, true);
|
||||||
var returned = checkReturned(searchIndex[i], val, true);
|
var returned = checkReturned(searchIndex[i], val, true);
|
||||||
var ty = searchIndex[i];
|
var ty = searchIndex[i];
|
||||||
var fullId = itemTypes[ty.ty] + ty.path + ty.name;
|
var fullId = generateId(ty);
|
||||||
|
|
||||||
if (searchWords[i] === val.name) {
|
if (searchWords[i] === val.name) {
|
||||||
// filter type: ... queries
|
// filter type: ... queries
|
||||||
|
@ -786,7 +793,7 @@
|
||||||
if (!type) {
|
if (!type) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var fullId = itemTypes[ty.ty] + ty.path + ty.name;
|
var fullId = generateId(ty);
|
||||||
|
|
||||||
// allow searching for void (no output) functions as well
|
// allow searching for void (no output) functions as well
|
||||||
var typeOutput = type.output ? type.output.name : "";
|
var typeOutput = type.output ? type.output.name : "";
|
||||||
|
@ -872,7 +879,7 @@
|
||||||
var index = -1;
|
var index = -1;
|
||||||
// we want lev results to go lower than others
|
// we want lev results to go lower than others
|
||||||
var lev = MAX_LEV_DISTANCE + 1;
|
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 ||
|
if (searchWords[j].indexOf(split[i]) > -1 ||
|
||||||
searchWords[j].indexOf(val) > -1 ||
|
searchWords[j].indexOf(val) > -1 ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue