Skip to content

Add providesIncludes field to library search scope #1893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
per1234 opened this issue Sep 24, 2022 · 1 comment · Fixed by #1896
Closed
3 tasks done

Add providesIncludes field to library search scope #1893

per1234 opened this issue Sep 24, 2022 · 1 comment · Fixed by #1896
Assignees
Labels
criticality: medium Of moderate impact topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@per1234
Copy link
Contributor

per1234 commented Sep 24, 2022

Describe the request

Add the providesIncludes field of the library index to the search scope of the arduino-cli lib search command.

🙂 The chances of finding a library by searching for its header filename will be increased.

$ arduino-cli lib search painlessMesh
Downloading index: library_index.json.gz downloaded
Downloading index signature: library_index.json.sig downloaded
Name: "Painless Mesh"
  Author: Coopdis,Scotty Franzyshen,Edwin van Leeuwen,Germán Martín,Maximilian Schwarz,Doanh Doanh
  Maintainer: Edwin van Leeuwen
  Sentence: A painless way to setup a mesh with ESP8266 and ESP32 devices
  Paragraph: A painless way to setup a mesh with ESP8266 and ESP32 devices
  Website: https://gitlab.com/painlessMesh/painlessMesh
  Category: Communication
  Architecture: esp8266, esp32
  Types: Contributed
  Versions: [0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.2.0, 0.2.1, 0.5.0, 0.5.4, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.5, 0.7.0, 1.0.0, 1.0.2, 1.0.3, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.5.0]
  Provides includes: painlessMesh.h
  Dependencies: ArduinoJson, TaskScheduler

Describe the current behavior

The scope of arduino-cli lib search is the following fields of the library index:

toTest := []string{lib.Name, lib.Latest.Paragraph, lib.Latest.Sentence}

  • 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 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.

Arduino CLI version

5730e2e

Operating system

Windows

Operating system version

10

Additional context

Example of a user who would have benefited from this: #107 (comment)


Feature request for Arduino IDE 1.x: arduino/Arduino#7604

Arduino IDE 1.x implementation: arduino/Arduino@60021c1

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@per1234 per1234 added criticality: medium Of moderate impact topic: code Related to content of the project itself type: enhancement Proposed improvement labels Sep 24, 2022
@cmaglie cmaglie mentioned this issue Sep 26, 2022
5 tasks
@cmaglie
Copy link
Member

cmaglie commented Sep 28, 2022

Fixed by #1896

@cmaglie cmaglie closed this as completed Sep 28, 2022
@per1234 per1234 linked a pull request Sep 28, 2022 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
criticality: medium Of moderate impact topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants