Skip to content

Commit 60021c1

Browse files
committed
Library search now works also for headers (.h) provided by libraries
Fixes #7604
1 parent e18261f commit 60021c1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/src/cc/arduino/contributions/libraries/ui/LibrariesIndexTableModel.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,12 @@ private boolean filterCondition(ContributedLibraryReleases lib) {
145145
}
146146

147147
ContributedLibrary latest = lib.getLatest();
148-
String compoundTargetSearchText = latest.getName() + "\n" + latest.getParagraph()
149-
+ "\n" + latest.getSentence();
148+
String compoundTargetSearchText = latest.getName() + " "
149+
+ latest.getParagraph() + " "
150+
+ latest.getSentence();
151+
if (latest.getProvidesIncludes() != null) {
152+
compoundTargetSearchText += " " + latest.getProvidesIncludes();
153+
}
150154
if (!stringContainsAll(compoundTargetSearchText, selectedFilters)) {
151155
return false;
152156
}

arduino-core/src/cc/arduino/contributions/libraries/ContributedLibrary.java

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public abstract class ContributedLibrary extends DownloadableContribution {
6565

6666
public abstract List<ContributedLibraryReference> getRequires();
6767

68+
public abstract List<String> getProvidesIncludes();
69+
6870
public static final Comparator<ContributedLibrary> CASE_INSENSITIVE_ORDER = (o1, o2) -> o1.getName().compareToIgnoreCase(o2.getName());
6971

7072
private Optional<UserLibrary> installedLib = Optional.empty();

0 commit comments

Comments
 (0)