Skip to content

Update zsh completion scripts #2

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

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

Conversation

benknoble
Copy link

@benknoble benknoble commented Nov 26, 2024

I updated or added the completion code for the commands I use (since those were the ones I could best evaluated).

Further notes:

  • I tried to keep each patch small, so the aggregate may look large but should be reviewable in pieces.
  • I didn't update raco's checksum because I have non-standard tools installed that would change the correct checksum.
  • For extremely simple completions, the following Vim macro can turn the help text (two lines of --arg and description) into an _arguments argument (depends on surround; provides a decent starting point for many complex completions):
    yypkyssbyss'Jxjyss]yss'kJxj
    
  • I'm willing to drop the (almost tip) commit 7d05838 (todo: note a problem with top-level collections, 2024-11-26), but I noticed a problem and don't have a good suggestion (yet) on how to fix it. I figured I'd share the information I learned while playing with the code.

Suggestions for improvement welcome, particularly to remove almost-but-not-quite-duplicate code or the post-processing on raco pkg show output.

@benknoble
Copy link
Author

benknoble commented Dec 21, 2024

Fixed a show-stopping bug with raco make completion:

range-diff:
 1:  db5d8f7 !  1:  1d2e4bc zsh: update raco make completion
    @@ racket-completion.zsh: _raco_cmd_exe() {
      _raco_cmd_make() {
        _arguments "$RACKET_COMMON[@]" \
     -    '(-j)'-j'+[Use N parallel jobs]:cores: ' \
    -+    '*'-l'[Compile path as a collection-based module path]:path:->libfile'
    ++    '*'-l'[Compile path as a collection-based module path]:path:->libfile' \
     +    '(-j)'-j'[Use N parallel jobs]:cores: ' \
          '(--disable-inline)'--disable-inline'[Disable procedure inlining during compilation]' \
          '(--disable-constant)'--disable-constant'[Disable enforcement of module constants]' \
 2:  5284ac9 =  2:  f31919f zsh: update raco distribute completion
 3:  dc88c19 =  3:  53a2c7d zsh: update raco expand completion
 4:  95b3fce =  4:  5497abc zsh: update raco test completion
 5:  94f90af =  5:  e898705 zsh: update racket completion
 6:  4e120b8 =  6:  91b0862 zsh: add raco pkg completion
 7:  8e685cd =  7:  cf8517c zsh: add raco pkg install completion
 8:  1901d39 =  8:  4444b14 zsh: add raco pkg update completion
 9:  113a343 =  9:  e516c11 zsh: add raco pkg uninstall completion
10:  6eaeb44 = 10:  06a8ec6 zsh: complete installed packages in some commands
11:  07c6028 = 11:  65c247e zsh: add raco pkg new completion
12:  7149971 = 12:  5c3823b zsh: add raco pkg show completion
13:  db1ffc2 = 13:  3c1e766 zsh: add raco pkg migrate completion
14:  0d7fe0d = 14:  4ebf9b3 fix unused variables/imports in main program
15:  7d05838 = 15:  f455417 todo: note a problem with top-level collections
16:  697cd65 = 16:  b315c8d zsh: complete migratable versions in raco pkg migrate

Technically for update --auto implies more than just --deps search-auto…

Depends on changes to raco pkg migrate to add --auto from
racket/racket#5124
benknoble added a commit to benknoble/Dotfiles that referenced this pull request Dec 21, 2024
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