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

completion: teach jj about aliases #4832

Merged
merged 2 commits into from
Nov 14, 2024
Merged

completion: teach jj about aliases #4832

merged 2 commits into from
Nov 14, 2024

Conversation

senekor
Copy link
Collaborator

@senekor senekor commented Nov 11, 2024

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

@senekor senekor mentioned this pull request Nov 11, 2024
18 tasks
@senekor senekor force-pushed the remo/complete-aliases branch from 79181fb to c8ad0ea Compare November 11, 2024 21:07
cli/src/complete.rs Outdated Show resolved Hide resolved
@ilyagr
Copy link
Collaborator

ilyagr commented Nov 12, 2024

Re commit descriptions: at a glance, it's hard to tell how "teach jj about alias" is different from "resolve aliases" from 325402d . I'm sure it'd be clearer if I read the code, but I'd still appreciate a short explanation in the description (assuming this PR indeed does something different).

@senekor senekor force-pushed the remo/complete-aliases branch from c8ad0ea to d950f8f Compare November 12, 2024 04:51
@senekor
Copy link
Collaborator Author

senekor commented Nov 12, 2024

I added an explanation to the description, let me know if it can still be improved.

@senekor senekor force-pushed the remo/complete-aliases branch 5 times, most recently from dc463af to d33fbec Compare November 14, 2024 15:49
cli/tests/test_completion.rs Show resolved Hide resolved
cli/tests/test_completion.rs Show resolved Hide resolved
This makes completions suggest aliases from the user or repository
configuration. It's more useful for long aliases that aren't used very often,
but serve the purpose of "executable documentation" of complex and useful jj
commands.

An earlier patch "resolved" aliases, meaning that any arguments following an
alias would be completed as if the normal command had been used. So it only
made sure that using aliases doesn't degrade the rest of the completions.
Commit ID: 325402d
@senekor senekor force-pushed the remo/complete-aliases branch from d33fbec to 1192a46 Compare November 14, 2024 17:43
@senekor senekor merged commit 26ccc1c into main Nov 14, 2024
31 checks passed
@senekor senekor deleted the remo/complete-aliases branch November 14, 2024 18:51
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.

3 participants