Commit fdc6df6
Per fdncred's recommendation in nushell/nushell#18128, replaces the
parameter-level `[...args: string@\"nu-complete wt\"]` with a
function-level `@complete` attribute on an untyped `[...args]` rest. The
completer signature moves from `[context: string]` (with manual `split
row \" \"` reconstruction) to `[spans: list<string>]`, which nushell
pre-tokenizes — net deletion of seven lines of fragile token reassembly.
Untyped rest is the form nushell routes through its normal
external-argument handling, so once nushell/nushell#18131 ships in
stable nu the wrapper will automatically benefit from `--flag=\"value\"`
quote stripping and `~` expansion without further changes. Until then
`--flag=\"value\"` still arrives at the binary with literal quotes — a
pre-existing bug, not a regression introduced here. Supersedes #2437
(the body-level regex strip workaround).
## Test plan
- [x] `cargo test --test integration --features shell-integration-tests`
— 1717 passed (including all four nu wrapper cases)
- [x] `pre-commit run --all-files` — clean
- [x] Smoke-tested the rendered template parses cleanly under nu 0.112.1
- [ ] Hand-verify subcommand completion at trailing space (e.g. `wt
switch <TAB>`) in an interactive nu session — couldn't drive reedline
via PTY in test, but fdncred's example in nushell/nushell#18128 implies
`spans` is populated at the cursor position
Ref nushell/nushell#18128, nushell/nushell#18131
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 53fd613 commit fdc6df6
2 files changed
Lines changed: 22 additions & 20 deletions
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 20 | | |
28 | | - | |
| 21 | + | |
29 | 22 | | |
30 | 23 | | |
31 | 24 | | |
| |||
66 | 59 | | |
67 | 60 | | |
68 | 61 | | |
69 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 16 | | |
24 | | - | |
| 17 | + | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
| |||
62 | 55 | | |
63 | 56 | | |
64 | 57 | | |
65 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
0 commit comments