mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Exclude deprecated params from search list
Only show param info if the exact field name/alias is entered Bug: T207897 Change-Id: Ic5be8b8cd7698b88ab89d771769f2e9ba407dfa9
This commit is contained in:
parent
27fdbe0581
commit
ae1095d313
|
@ -116,7 +116,8 @@ ve.ui.MWParameterSearchWidget.prototype.buildIndex = function () {
|
|||
name: name,
|
||||
label: label,
|
||||
aliases: aliases,
|
||||
description: description
|
||||
description: description,
|
||||
deprecated: spec.isParameterDeprecated( name )
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -146,6 +147,10 @@ ve.ui.MWParameterSearchWidget.prototype.addResults = function () {
|
|||
nameMatch = item.names.indexOf( query ) >= 0;
|
||||
}
|
||||
if ( !hasQuery || textMatch || nameMatch ) {
|
||||
// Only show exact matches for deprecated params
|
||||
if ( item.deprecated && query !== item.name && item.aliases.indexOf( query ) === -1 ) {
|
||||
continue;
|
||||
}
|
||||
items.push( new ve.ui.MWParameterResultWidget( { data: item } ) );
|
||||
if ( hasQuery && nameMatch ) {
|
||||
exactMatch = true;
|
||||
|
|
Loading…
Reference in a new issue