Revert #7779 (enables back subcommand completions)#8102
Revert #7779 (enables back subcommand completions)#8102kubouch merged 2 commits intonushell:mainfrom
Conversation
…ias name is shorter than the alias command and the alias command is an external command. (nushell#7779)" This reverts commit 8acced5.
1dc5356 to
f81e8ec
Compare
|
@Xoffio Unfortunately, the broken subcommand completions are a big hit in user experience that we thought it would be better to revert it. Your PR fixed the crash fine, though, it is a pity. Do you know what might have caused the subcommand completions to not work anymore? |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8102 +/- ##
==========================================
+ Coverage 54.15% 54.17% +0.01%
==========================================
Files 608 608
Lines 99131 99109 -22
==========================================
+ Hits 53688 53689 +1
+ Misses 45443 45420 -23
|
|
@kubouch It is fine! I think the code related to auto completion is a bit messy. Correct me if I am wrong but I think we have like an array where all the auto completion is saved but also the aliases which makes it hard to know what we are dealing with from different sections of the code. Maybe I change the offset to avoid the crash but that might also avoid the auto completion? maybe... |
|
Yes, I was just looking at the completions code and the aliases combined with manual span handling make it really messy. I found that before your PR, the command completion created at this line returned correct subcommand completions (e.g. when typingconfig and pressing Tab). After your PR, the returned output was empty.
|
Description
Reverts the PR #7779 which breaks subcommand completions. The issues #7648 and #7754 thus still need fixing.
This reverts commit 8acced5.
User-Facing Changes
Enables subcommand completions.
Unfortunately, also brings back the completion panic if alias is shorter than the command name.
Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspaceto check that all tests passAfter Submitting
If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.