You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
oneof<> parameter parsing with lists is incorrect #16445
When using oneof<s, list<any>>, where s is a string-like type (string, path, glob), as the type annotation of a custom command's parameter, lists are incorrectly parsed as the type s.
Swapping the order of the two types in the oneof annotation correctly parses lists and single values, however.
How to reproduce
Define the function with a parameter: def foo [s: oneof<glob, list<any>>] { $s | inspect }
Run the command
>foo [foobarbaz] # Note that `[foo bar baz]` will be highlighted as a glob in the repl╭─────────────┬──────╮│description│glob│├─────────────┴──────┤││├────────────────────┤│ [foobarbaz] │╰────────────────────╯
[foobarbaz]
Expected behavior
The value should be a list of three elements, to match the swapped version mentioned above; or at least bar and baz] should be treated as extra arguments and cause an error.
Configuration
key
value
version
0.106.1
major
0
minor
106
patch
1
branch
commit_hash
build_os
linux-x86_64
build_target
x86_64-unknown-linux-gnu
rust_version
rustc 1.88.0 (6b00bc388 2025-06-23) (built from a source tarball)
I think I've run into this before (just observed with the LSP).
off-topic comment about the LSP
The LSP is either quite buggy, or just exposes a lot of parser bugs. I haven't been reporting them because I'm not even sure which version of the LSP my new zed setup is using.
The LSP is either quite buggy, or just exposes a lot of parser bugs. I haven't been reporting them because I'm not even sure which version of the LSP my new zed setup is using.
The version of nu-lsp upgrades with nu. I think you should report them.
Activity
ItsHarper commentedon Aug 16, 2025
I think I've run into this before (just observed with the LSP).
off-topic comment about the LSP
The LSP is either quite buggy, or just exposes a lot of parser bugs. I haven't been reporting them because I'm not even sure which version of the LSP my new
zedsetup is using.blindFS commentedon Aug 19, 2025
Same for other types
blindFS commentedon Aug 19, 2025
The version of nu-lsp upgrades with nu. I think you should report them.
ItsHarper commentedon Aug 19, 2025
I did know that, but I also know that zed likes to download LSPs on its own and I'm not sure if it's using my system's
nubinary or not.blindFS commentedon Aug 19, 2025
FYI https://github.com/zed-extensions/nu/blob/b8ed585150118b4c2f91d97e200b9972d775052c/src/nu.rs#L16-L24
ItsHarper commentedon Aug 19, 2025
Lovely, thank you! I'll definitely start reporting bugs then.
fix(parser): try `string` last in `oneof` so `oneof<string, list<stri…