rizin icon indicating copy to clipboard operation
rizin copied to clipboard

autocomplete eco

Open gargpratyush opened this issue 8 months ago • 2 comments

Your checklist for this pull request

  • [x] I've read the guidelines for contributing to this repository.
  • [x] I made sure to follow the project's coding style.
  • [x] I've documented every RZ_API function and struct this PR changes.
  • [x] I've added tests that prove my changes are effective (required for changes to RZ_API).
  • [x] I've updated the Rizin book with the relevant information (if needed).

Detailed description

This PR implements autocomplete functionality for the eco command, which allows users to load themes or list available themes. When a user types "eco" and presses TAB, they will now see a list of available theme names as suggestions.

The implementation includes:

  1. A new callback function theme_choices_cb that retrieves the list of available themes
  2. Proper documentation for the function using Doxygen-style comments
  3. Correct pointer modifiers (RZ_OWN and RZ_NONNULL) to indicate ownership and nullability
  4. Integration with the existing command system through the YAML configuration

This enhancement improves the user experience by making it easier to discover and use available themes without having to remember their exact names or use the list command first.

...

Test plan

To test this change:

  1. Build Rizin with the changes
  2. Run Rizin
  3. Type "eco" and press TAB
  4. Verify that a list of available theme names appears as suggestions
  5. Select a theme name from the suggestions and press Enter
  6. Verify that the theme is loaded correctly

Demo testing:

https://github.com/user-attachments/assets/3e621fab-3664-4fc8-a135-7ff283872c8b

Closing issues

Closes https://github.com/rizinorg/rizin/pull/5075

gargpratyush avatar Apr 06 '25 06:04 gargpratyush

Codecov Report

:x: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 43.85%. Comparing base (a17da6c) to head (efea6cf). :warning: Report is 302 commits behind head on dev.

Files with missing lines Patch % Lines
librz/core/cmd/cmd_eval.c 0.00% 14 Missing :warning:
Additional details and impacted files
Files with missing lines Coverage Δ
librz/core/cmd_descs/cmd_descs.c 51.53% <ø> (ø)
librz/include/rz_cmd.h 71.42% <ø> (ø)
librz/core/cmd/cmd_eval.c 54.76% <0.00%> (-2.11%) :arrow_down:

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a17da6c...efea6cf. Read the comment docs.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Apr 06 '25 12:04 codecov[bot]

@gargpratyush please add a test

notxvilka avatar May 23 '25 14:05 notxvilka

Superseded by https://github.com/rizinorg/rizin/pull/5488

notxvilka avatar Nov 11 '25 17:11 notxvilka