Skip to content

Commit

Permalink
change(sdkconfig): improved SDKConfigurationFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaaa committed Sep 29, 2023
1 parent 05177fd commit 1e03b89
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ public class SDKConfigurationFilter extends PatternFilter
@Override
protected boolean isLeafMatch(Viewer viewer, Object element)
{

if (element instanceof KConfigMenuItem)
{
KConfigMenuItem highLevelElem = (KConfigMenuItem) element;

return wordMatches(highLevelElem.getTitle()) || recursiveMatch(highLevelElem);
return wordMatches(highLevelElem.getTitle()) || wordMatches(highLevelElem.getName())
|| recursiveMatch(highLevelElem);
}

return false;
Expand All @@ -25,12 +25,12 @@ private boolean recursiveMatch(KConfigMenuItem parent)
{
if (parent.getChildren().isEmpty())
{
return wordMatches(parent.getName());
return wordMatches(parent.getName()) || wordMatches(parent.getTitle());
}

for (KConfigMenuItem child : parent.getChildren())
{
if (wordMatches(child.getName()) || recursiveMatch(child))
if (wordMatches(child.getName()) || wordMatches(child.getTitle()) || recursiveMatch(child))
{
return true;
}
Expand Down

0 comments on commit 1e03b89

Please sign in to comment.