Repository navigation
fix(cli): put tasks first in zsh dynamic completions - #31350
Conversation
WalkthroughThe pull request adds the Sequence DiagramsequenceDiagram
participant User
participant CLI
participant CompleteEnv
participant ZshCompleterUnsorted
participant Zsh
User->>CLI: Request shell completion
CLI->>CompleteEnv: with_factory([Bash, Elvish, Fish, PowerShell, ZshCompleterUnsorted])
alt Zsh Shell Detected
CompleteEnv->>ZshCompleterUnsorted: is() check
ZshCompleterUnsorted-->>CompleteEnv: true
CompleteEnv->>ZshCompleterUnsorted: write_registration()
ZshCompleterUnsorted-->>Zsh: Registration script (preserves order)
CompleteEnv->>ZshCompleterUnsorted: write_complete()
ZshCompleterUnsorted-->>Zsh: Completion candidates
else Other Shell
CompleteEnv->>CompleteEnv: Use standard completer
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🔇 Additional comments (5)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes zsh dynamic completions to preserve the order of completion suggestions (putting tasks first) by implementing a custom zsh completer that uses the -o nosort flag.
- Adds
ZshCompleterUnsortedstruct implementingEnvCompletertrait with custom zsh script generation - Configures
CompleteEnvto use custom shells list including the new zsh completer - Adds
shlexdependency for proper shell escaping
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cli/args/flags.rs | Implements custom zsh completer with -o nosort flag and updates shell completion configuration |
| cli/Cargo.toml | Adds shlex dependency to workspace members |
| Cargo.toml | Adds shlex 1.3.0 to workspace dependencies |
| Cargo.lock | Updates lock file with shlex dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
It's kind of annoying because it requires copying some code from clap, but it's the only solution I could find
It's kind of annoying because it requires copying some code from clap, but it's the only solution I could find