Skip to content
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

Add completion for examples #149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PuercoPop
Copy link

@PuercoPop PuercoPop commented Apr 9, 2024

This PR adds completion support to M-x cargo-process-run-example. It shells out to cargo metadata --no-deps to retrieve the list of examples.

One 'cons' is that it adds cl-lib, due to me being more familiar with Common Lisp than Elisp. Others may the JSON drilling to be done using map.el or seq.el I saw that cargo.el already uses cl-lib (cl-loop), it is simply missing the require form + being explicitly declared as a dependency

To get a list of all the examples in a project we can use the cargo metadata
command and filter through the targets that have "example" kind. We need to pass
the --no-deps flags so that we ignore targets from dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant