Skip to content

Commit

Permalink
change(sdkconfig): improved SDKConfigurationFilter (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaaa authored Oct 5, 2023
1 parent 1002ae4 commit 0267c08
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 0267c08

Please sign in to comment.