fix(completions): require usage 3.5#10313
Conversation
📝 WalkthroughWalkthroughMinimum ChangesUsage 3.5 update and zsh completion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Greptile SummaryThis PR bumps the
Confidence Score: 5/5Safe to merge — all changes are a coordinated version bump with no runtime logic changes beyond the completion script rewrite, which is straightforward and correct. All five files are touched only to advance the usage version from 3.4 to 3.5. The completion script rewrite in completions/_mise correctly handles the new 3-column output format: the array indexing, padding arithmetic, and compadd call are all well-formed zsh. Checksums are updated for every platform in mise.lock, and the version guard in both the KDL spec and the Rust source are in sync. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(completions): require usage 3.5" | Re-trigger Greptile |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.2 x -- echo |
19.4 ± 0.7 | 17.9 | 23.1 | 1.00 |
mise x -- echo |
20.5 ± 1.6 | 18.5 | 41.9 | 1.06 ± 0.09 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.2 env |
19.4 ± 0.9 | 17.5 | 24.4 | 1.00 |
mise env |
21.2 ± 1.1 | 18.9 | 26.7 | 1.09 ± 0.08 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.2 hook-env |
20.2 ± 1.1 | 18.1 | 26.9 | 1.00 |
mise hook-env |
20.6 ± 1.5 | 18.3 | 26.7 | 1.02 ± 0.09 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.2 ls |
15.7 ± 0.8 | 14.2 | 19.0 | 1.00 |
mise ls |
15.9 ± 0.7 | 14.6 | 19.8 | 1.01 ± 0.07 |
xtasks/test/perf
| Command | mise-2026.6.2 | mise | Variance |
|---|---|---|---|
| install (cached) | 135ms | 135ms | +0% |
| ls (cached) | 58ms | 59ms | -1% |
| bin-paths (cached) | 62ms | 65ms | -4% |
| task-ls (cached) | 127ms | 126ms | +0% |
09f6325 to
c96601b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@completions/_mise`:
- Around line 34-37: The parser currently assumes 3 fields and unconditionally
does values+=("${parts[1]}"), descs+=("${parts[2]}"), inserts+=("${parts[3]}"),
which produces empty inserts for 2-column rows; change the logic around parts to
detect when parts[3] is empty and parts[2] exists, and in that case treat
parts[2] as the insert (i.e. append parts[2] to inserts and append an empty
string to descs), otherwise keep the current mapping; also ensure you only
append non-empty inserts to avoid compadd -a inserts receiving empty entries and
keep the needs_menu check using the actual insert value (the variable inserts /
the element that was appended).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8c8b61df-a448-46b9-8ced-7d802c8415d3
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockmise.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
completions/_misemise.usage.kdlsrc/cli/usage.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- src/cli/usage.rs
- mise.usage.kdl
| values+=("${parts[1]}") | ||
| descs+=("${parts[2]}") | ||
| inserts+=("${parts[3]}") | ||
| [[ "${parts[3]}" == "'"* ]] && needs_menu=1 |
There was a problem hiding this comment.
Handle 2-column completion rows before calling compadd -a inserts.
This parser assumes 3 fields, but the provided completion examples are 2-field tab rows (value<TAB>insert). In that case, parts[3] is empty, inserts becomes empty entries, and compadd -a inserts can stop inserting the actual token.
Suggested fix
while IFS= read -r line; do
local -a parts=("${(`@ps`:\t:)line}")
- values+=("${parts[1]}")
- descs+=("${parts[2]}")
- inserts+=("${parts[3]}")
- [[ "${parts[3]}" == "'"* ]] && needs_menu=1
+ local _value="${parts[1]}"
+ local _desc=""
+ local _insert=""
+
+ if (( ${`#parts`[@]} >= 3 )); then
+ _desc="${parts[2]}"
+ _insert="${parts[3]}"
+ elif (( ${`#parts`[@]} == 2 )); then
+ _insert="${parts[2]}"
+ else
+ _insert="${parts[1]}"
+ fi
+
+ values+=("${_value}")
+ descs+=("${_desc}")
+ inserts+=("${_insert}")
+ [[ "${_insert}" == "'"* ]] && needs_menu=1
done < <(command usage complete-word --shell zsh -f "$spec_file" -- "${(Q)words[@]}")As per coding guidelines, this is based on the provided runtime evidence snippet showing 2-field completion rows in e2e/tasks/test_task_completion_global_cd:13-48.
Also applies to: 40-55
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@completions/_mise` around lines 34 - 37, The parser currently assumes 3
fields and unconditionally does values+=("${parts[1]}"), descs+=("${parts[2]}"),
inserts+=("${parts[3]}"), which produces empty inserts for 2-column rows; change
the logic around parts to detect when parts[3] is empty and parts[2] exists, and
in that case treat parts[2] as the insert (i.e. append parts[2] to inserts and
append an empty string to descs), otherwise keep the current mapping; also
ensure you only append non-empty inserts to avoid compadd -a inserts receiving
empty entries and keep the needs_menu check using the actual insert value (the
variable inserts / the element that was appended).
Summary
This picks up the zsh colon completion fixes from jdx/usage#666 and jdx/usage#670.
Tests
Note
Low Risk
Dependency and completion-script updates only; no runtime behavior changes beyond shell tab completion and dev-tool pinning.
Overview
Bumps the usage toolchain to 3.5.0 (
usage-libinCargo.lock, lockedusageinmise.lock) and raisesmin_usage_versionin the generated usage spec from 3.4 to 3.5 so older CLIs cannot silently hit broken zsh colon completion (jdx/usage#666, #670).The generated zsh completion script
completions/_misenow consumes three tab-separated fields fromusage complete-word(value, description, insert), shows padded labels with--descriptions, and usescompaddinstead of_describe—aligned with usage 3.5’s completion output.Reviewed by Cursor Bugbot for commit c96601b. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Chores
usageCLI tool to 3.5 to ensure full compatibility with current infrastructure requirements and latest improvements.