Closed Hofer-Julian closed 1 year ago
tried to repro and it totally hung my windows terminal - no clue what's going on here but i have an idea of something to check. since cargo run --bin <tab>
calls the "nu-complete cargo bins"
command what happens if you call it directly? (you have to change it from a module to a regular script to call these directly)
Oh! I think i see what is going on. If you look at this command.
def "nu-complete cargo bins" [] { nu-complete cargo targets bin }
it's calling another completer
def "nu-complete cargo targets" [type: string] {
cargo metadata --format-version=1 --offline --no-deps | from json | get packages.targets | flatten | where ($type in $it.kind) | get name
}
is that legal? also, should nu-complete cargo targets
be in quotes when calling it?
the completers appear to work when called directly. i'm transferring to nushell. i'm thinking there may be a bug there.
i changed the cargo completions so i could run the completers normally.
> cd .\ripgrep\
> nu-complete cargo bins
╭───┬────╮
│ 0 │ rg │
╰───┴────╯
> nu-complete cargo examples
╭───┬──────────────╮
│ 0 │ simplegrep │
│ 1 │ search-stdin │
│ 2 │ walk │
╰───┴──────────────╯
> cargo run --bin <tab>
the last command just hangs and i'm not sure why. is it a bug in the completion script or a bug in how nushell is trying to complete. It's not clear since there is no error message and it just hangs.
more research. it seems that this command is hanging
"C:\\Users\\username\\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe" metadata --format-version=1 --offline --no-deps
i can kill that subprocess and the hanging part ends.
Closing this, as we don't ship with cargo completions anymore. If there are bugs on the cargo completions, we should probably file them on nu_scripts (if they still repro) or if we think it's a nushell related issue, then to reduce the repro and file a new issue here.
Problem:
If I use
cargo-completions
it freezes the terminal when I have one than more possibility.Steps to reproduce
cargo run --bin
in the terminal(The same thing happens with
cargo run --example
)Note
It is not obvious to me why that happens, it seems to do the same thing as the git completion which works fine. I've only tested this on Windows.