This commit is contained in:
Asuka Minato 2025-11-26 06:47:36 +09:00
parent 80d8f292d8
commit 48bd321a71
2 changed files with 26 additions and 3 deletions

View file

@ -5050,9 +5050,11 @@ ${obj.displayPath}<span class="${type}">${name}</span>\
if (query.proposeCorrectionFrom !== null && isTypeSearch) {
const orig = query.proposeCorrectionFrom;
const targ = query.proposeCorrectionTo;
correctionOutput = "<h3 class=\"search-corrections\">" +
`Type "${orig}" not found and used as generic parameter. ` +
`Consider searching for "${targ}" instead.</h3>`;
const parts = [`Type "${orig}" not found and used as generic parameter.`];
if (targ !== null) {
parts.push(`Consider searching for "${targ}" instead.`);
}
correctionOutput = `<h3 class="search-corrections">${parts.join(" ")}</h3>`;
}
if (firstResult.value) {
if (correctionOutput !== "") {

View file

@ -95,3 +95,24 @@ const EXPECTED = [
],
},
];
const PARSED = [
{
'query': 'Result<SomeTraiz>',
'userQuery': 'Result<SomeTraiz>',
'foundElems': 1,
'returned': [],
'error': null,
'proposeCorrectionFrom': 'SomeTraiz',
'proposeCorrectionTo': 'SomeTrait',
},
{
'query': 'Result<NoSuchTrait>',
'userQuery': 'Result<NoSuchTrait>',
'foundElems': 1,
'returned': [],
'error': null,
'proposeCorrectionFrom': 'NoSuchTrait',
'proposeCorrectionTo': null,
},
];