@@ -60,30 +60,32 @@ public void updateIndexFilter(String[] filters,
6060
6161 private void updateContributions () {
6262 contributions .clear ();
63+
64+ // Generate ContributedPlatformReleases from all platform releases
6365 for (ContributedPackage pack : BaseNoGui .indexer .getPackages ()) {
6466 for (ContributedPlatform platform : pack .getPlatforms ()) {
67+ addContribution (platform );
68+ }
69+ }
70+
71+ // Filter ContributedPlatformReleases based on search terms
72+ contributions .removeIf (releases -> {
73+ for (ContributedPlatform platform : releases .releases ) {
6574 String compoundTargetSearchText = platform .getName () + "\n "
6675 + platform .getBoards ().stream ()
6776 .map (ContributedBoard ::getName )
6877 .collect (Collectors .joining (" " ));
69-
70- // Add all the versions of the same core, even if there's no match
71- for (ContributedPlatformReleases contribution : contributions ) {
72- if (contribution .shouldContain (platform )) {
73- addContribution (platform );
74- continue ;
75- }
76- }
77-
7878 if (!filter .test (platform )) {
7979 continue ;
8080 }
8181 if (!stringContainsAll (compoundTargetSearchText , filters ))
8282 continue ;
83-
84- addContribution (platform );
83+ return false ;
8584 }
86- }
85+ return true ;
86+ });
87+
88+ // Sort ContributedPlatformReleases and put deprecated platforms to the bottom
8789 Collections .sort (contributions , (x ,y )-> {
8890 if (x .isDeprecated () != y .isDeprecated ()) {
8991 return x .isDeprecated () ? 1 : -1 ;
@@ -96,6 +98,7 @@ private void updateContributions() {
9698 }
9799 return x1 .getName ().compareToIgnoreCase (y1 .getName ());
98100 });
101+
99102 fireTableDataChanged ();
100103 }
101104
@@ -123,10 +126,6 @@ private void addContribution(ContributedPlatform platform) {
123126 if (!contribution .shouldContain (platform )) {
124127 continue ;
125128 }
126- if (contribution .contains (platform )) {
127- // no duplicates
128- return ;
129- }
130129 contribution .add (platform );
131130 return ;
132131 }
0 commit comments