@@ -60,30 +60,32 @@ public void updateIndexFilter(String[] filters,
60
60
61
61
private void updateContributions () {
62
62
contributions .clear ();
63
+
64
+ // Generate ContributedPlatformReleases from all platform releases
63
65
for (ContributedPackage pack : BaseNoGui .indexer .getPackages ()) {
64
66
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 ) {
65
74
String compoundTargetSearchText = platform .getName () + "\n "
66
75
+ platform .getBoards ().stream ()
67
76
.map (ContributedBoard ::getName )
68
77
.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
-
78
78
if (!filter .test (platform )) {
79
79
continue ;
80
80
}
81
81
if (!stringContainsAll (compoundTargetSearchText , filters ))
82
82
continue ;
83
-
84
- addContribution (platform );
83
+ return false ;
85
84
}
86
- }
85
+ return true ;
86
+ });
87
+
88
+ // Sort ContributedPlatformReleases and put deprecated platforms to the bottom
87
89
Collections .sort (contributions , (x ,y )-> {
88
90
if (x .isDeprecated () != y .isDeprecated ()) {
89
91
return x .isDeprecated () ? 1 : -1 ;
@@ -96,6 +98,7 @@ private void updateContributions() {
96
98
}
97
99
return x1 .getName ().compareToIgnoreCase (y1 .getName ());
98
100
});
101
+
99
102
fireTableDataChanged ();
100
103
}
101
104
@@ -123,10 +126,6 @@ private void addContribution(ContributedPlatform platform) {
123
126
if (!contribution .shouldContain (platform )) {
124
127
continue ;
125
128
}
126
- if (contribution .contains (platform )) {
127
- // no duplicates
128
- return ;
129
- }
130
129
contribution .add (platform );
131
130
return ;
132
131
}
0 commit comments