Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated external zoxide completer #1845

Open
blindFS opened this issue Mar 24, 2025 · 2 comments · May be fixed by #1847
Open

Outdated external zoxide completer #1845

blindFS opened this issue Mar 24, 2025 · 2 comments · May be fixed by #1847

Comments

@blindFS
Copy link

blindFS commented Mar 24, 2025

Some users reported that the config in https://www.nushell.sh/cookbook/external_completers.html#zoxide-completer
is no longer working in nu 0.103.

That is because I disabled external completer for arguments of internal commands in nushell/nushell#15086.

IMO, it's not a great idea to resort to the external completer for internals. If we can agree on that, that part of the documents need to be updated then. Maybe just delete that section, I'm not sure.

@132ikl
Copy link
Contributor

132ikl commented Mar 27, 2025

IMO, it's not a great idea to resort to the external completer for internals. If we can agree on that, that part of the documents need to be updated then.

We discussed this in the meeting yesterday, and we generally agree this is a good way forward. We would also really like to see spans being passed to internal completers, similar to how external completers work, rather than just a context string.

I think we could also provide a completer (in the cookbook, or maybe in std?) that would allow people to use their external completer for an internal command (similar to the old behavior) if they really wanted to, like so:

def "nu-complete external" [context: string] {
  do $env.config.completions.external.completer ($context | split row " ")
}

# my cool ssh wrapper
def ssh [...rest: string@"nu-complete external"] {
  ^ssh ...$rest
}

ssh <TAB>
# auto-complete results from carapace, in my case

@blindFS
Copy link
Author

blindFS commented Mar 28, 2025

We discussed this in the meeting yesterday, and we generally agree this is a good way forward. We would also really like to see spans being passed to internal completers, similar to how external completers work, rather than just a context string.

Does that mean another breaking change, or something like splitting string into spans if the argument type is list instead of string?

I think we could also provide a completer (in the cookbook, or maybe in std?) that would allow people to use their external completer for an internal command (similar to the old behavior) if they really wanted to, like so:

def "nu-complete external" [context: string] {
do $env.config.completions.external.completer ($context | split row " ")
}

my cool ssh wrapper

def ssh [...rest: string@"nu-complete external"] {
^ssh ...$rest
}

ssh

auto-complete results from carapace, in my case

That's cool, should I add that example to external_completer.md and link it to custom_completions.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants