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

Enable fish to complete recipes in modules #2514

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

senekor
Copy link
Contributor

@senekor senekor commented Dec 10, 2024

Hi, thanks for making just. One of the big reasons for me to use it is because of the completions. However, recipes in modules aren't completed at all (in fish), so I basically didn't use that feature.

I ended up writing the completions for that myself. I have them checked into my dotfiles now, so merging this PR isn't urgent for me. I thought I'd share it in case it is deemed useful for others.

It's quite a bit more verbose, but I didn't find a way to make it more concise without also making it more obtuse and hard to understand.

I should also say that this logic parses the output of:

just --list \
     --list-heading='' \
     --list-prefix='>' \
     --list-submodules

I might have missed some edge cases of that output format if it's related to a feature I personally don't use. For example, I haven't used groups so far, I only noticed my lack of handling [group_name] headers when I tried out my completions on the just repo itself. Recipe arguments and descriptions should be handled the same way as the existing completions.

@casey
Copy link
Owner

casey commented Dec 10, 2024

Nice! Can you use just --summary instead, which doesn't have any formatting?

@senekor senekor force-pushed the senekor/vuqpozsmyuzy branch 3 times, most recently from e999f2d to bafe00a Compare December 10, 2024 23:08
@senekor senekor force-pushed the senekor/vuqpozsmyuzy branch from bafe00a to 6e107e0 Compare December 10, 2024 23:13
@senekor
Copy link
Contributor Author

senekor commented Dec 10, 2024

Wow, that's so much simpler! 👍

This approach does lose hints for the recipe arguments and description, but I don't think it's a big loss.

@casey
Copy link
Owner

casey commented Dec 10, 2024

Hmm, it's unfortunate to lose recipe arguments and descriptions, but I do think overall it's an improvement to be able to complete recipes in modules.

@casey casey enabled auto-merge (squash) December 10, 2024 23:40
@casey casey merged commit 5c691a8 into casey:master Dec 10, 2024
5 checks passed
@senekor senekor deleted the senekor/vuqpozsmyuzy branch December 10, 2024 23:43
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.

2 participants