Skip to content

Add 2 index arguments to custom shell completion calls#763

Merged
natecook1000 merged 3 commits into
apple:mainfrom
rgoldberg:757-custom-completion-indicies
May 7, 2025
Merged

Add 2 index arguments to custom shell completion calls#763
natecook1000 merged 3 commits into
apple:mainfrom
rgoldberg:757-custom-completion-indicies

Conversation

@rgoldberg

Copy link
Copy Markdown
Collaborator

Add 2 index arguments to custom shell completion calls.

They indicate to the Swift custom completion function:

  1. the word for which completions are being requested.
  2. the location of the cursor within that word.

Resolve #757

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

They indicate to the Swift custom completion function:

1. the word for which completions are being requested.
2. the location of the cursor within that word.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
@rgoldberg

rgoldberg commented May 7, 2025

Copy link
Copy Markdown
Collaborator Author

@natecook1000 This is the last of my completed PRs.

The next one would be for ToolInfoV0 (#758), but that can only be a draft because I think ToolInfoV0 must be updated for completions to be based on it.

I will look into #761 & try to resolve it soon.

Other issues remain with the completions, but all shells should be in a better state than before.

@natecook1000 natecook1000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I verified locally that the deprecation messages are coming through properly. 👍🏻

Comment thread Sources/ArgumentParser/Parsable Properties/CompletionKind.swift Outdated
rgoldberg added 2 commits May 7, 2025 14:12
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
@rgoldberg

Copy link
Copy Markdown
Collaborator Author

@natecook1000 Pushed a spacing fix using Scripts/format.sh.

@natecook1000

Copy link
Copy Markdown
Member

@swift-ci Please test

@natecook1000 natecook1000 merged commit 42585ad into apple:main May 7, 2025
24 checks passed
@rgoldberg rgoldberg deleted the 757-custom-completion-indicies branch May 7, 2025 21:53
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.

Add 2 index parameters to custom shell completion function calls

2 participants