Often when searching for a dependency of someone's code the only information the user has is the #include directive for the missing file and so that filename is the logical term to use in a lib search query. That filename is not necessarily present in the fields currently used by lib search.
The includes field of the library.properties metadata file of Arduino libraries contains a list of the names of the library's header files which should be added in #include directives to a sketch when the library is selected from the Arduino IDE's Sketch > Include library menu. This list is the source of the elements of the providesIncludes array field of the library index. For this reason, the providesIncludes field is the source of highly relevant text for searches.
🙁 It is sometimes difficult to find a dependency when the user only knows the header filename.
$ arduino-cli version
arduino-cli.exe Version: git-snapshot Commit: 5730e2eb Date: 2022-09-24T17:05:10Z
$ arduino-cli lib search painlessMesh
Downloading index: library_index.json.gz downloaded
Downloading index signature: library_index.json.sig downloaded
No libraries matching your search.
Describe the request
Add the
providesIncludes
field of the library index to the search scope of thearduino-cli lib search
command.🙂 The chances of finding a library by searching for its header filename will be increased.
Describe the current behavior
The scope of
arduino-cli lib search
is the following fields of the library index:https://github.com/arduino/arduino-cli/blob/5730e2ebbed39452a3a0517bb3571a1b94d864f7/commands/lib/search.go#L44
name
sentence
paragraph
The scope of the search in Arduino IDE 1.x is the following fields of the library index:
https://github.com/arduino/Arduino/blob/1.8.19/app/src/cc/arduino/contributions/libraries/ui/LibrariesIndexTableModel.java#L147-L153
name
sentence
paragraph
providesIncludes
Often when searching for a dependency of someone's code the only information the user has is the
#include
directive for the missing file and so that filename is the logical term to use in alib search
query. That filename is not necessarily present in the fields currently used bylib search
.The
includes
field of thelibrary.properties
metadata file of Arduino libraries contains a list of the names of the library's header files which should be added in#include
directives to a sketch when the library is selected from the Arduino IDE's Sketch > Include library menu. This list is the source of the elements of theprovidesIncludes
array field of the library index. For this reason, theprovidesIncludes
field is the source of highly relevant text for searches.🙁 It is sometimes difficult to find a dependency when the user only knows the header filename.
Arduino CLI version
5730e2eb
Operating system
Windows
Operating system version
10
Additional context
Example of a user who would have benefited from this: https://github.com/arduino/arduino-cli/issues/107#issuecomment-814278260
Feature request for Arduino IDE 1.x: https://github.com/arduino/Arduino/issues/7604
Arduino IDE 1.x implementation: https://github.com/arduino/Arduino/commit/60021c1e6394e20b33c58a587141eb86c11db5c9
Issue checklist