Skip to content

fix(env): use the named completer input in env.nu for Nushell 0.116 - #3267

Merged
fengmk2 merged 7 commits into
voidzero-dev:mainfrom
naokihaba:fix/nushell-completer-input
Oct 29, 2026
Merged

fengmk2 merged 7 commits into
voidzero-dev:mainfrom
naokihaba:fix/nushell-completer-input

Conversation

@naokihaba

@naokihaba naokihaba commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Context

Nushell 0.116 deprecates positional completer input. A completer now gets its input by parameter name (buffer, place, token). The env.nu completers still use a positional context parameter, so each completion shows a deprecation warning, and completion will stop when Nushell removes the old form. This PR moves the completers to the named input now. See Unified custom completions.

Before (Nushell 0.116.1)

/> vp env
Warning: nu::shell::deprecated

  ⚠ Positional completer input deprecated.
    ╭─[~/.vite-plus/env.nu:42:40]
 42 │ ╭─▶ def "nu-complete vp" [context: string] {
    · ╰──── declares the legacy positional input `context`
  help: ... `context` still receives its old positional value for compatibility,
        but this bridge will be removed in a future release.

VITE+ - The Unified Toolchain for the Web

After

A=$(mktemp -d)
HOME=$A/home ZDOTDIR=$A/home XDG_CONFIG_HOME=$A/config VP_HOME=$A/vp VP_SELF_SETUP_NO_MODIFY_PATH=1 ./target/debug/vp env setup --env-only
nu -n -e "source '$A/vp/env.nu'"
> vp env
VITE+ - The Unified Toolchain for the Web

Usage: vp env [COMMAND]

Nushell 0.116 deprecates a positional completer parameter such as `context`. The env.nu completers now declare `buffer`, which Nushell 0.116 and later bind by name and earlier versions fill positionally. nu-complete vpr removes earlier pipeline elements from `buffer` before it translates `vpr` to `vp run`.

Closes voidzero-dev#3127
@naokihaba naokihaba self-assigned this Oct 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-29T04:29:33.733935Z af8b431 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

2 similar comments
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@naokihaba

naokihaba commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

@codex review

@codex review did not work, so I ran the checks locally. They pass.

On Nushell 0.116+, buffer holds the whole line up to the cursor. A quote in an earlier command ended the single-quoted fish argument, and the regex that removed earlier pipeline elements failed for multiline input and for delimiters inside quotes. The completers now use place.command, which Nushell parses, and pass the command to fish as an argument.
Nushell 0.115 and earlier pass the current command and the cursor
position by position. CI has only Nushell 0.116, so call the completers
in that form directly and compare the result with the completion of the
same line.
Move the current-command selection and the fish call into helpers that
the `vp` and `vpr` completers share, and document why `place` is `any`.
Nushell 0.115 always passes two positional values to a completer, and
Nushell 0.116 binds place by name. Neither release omits place, so make
the parameter required and remove the test call that omitted it.
@naokihaba
naokihaba marked this pull request as ready for review October 29, 2026 07:22
@naokihaba
naokihaba requested review from fengmk2 and nekomoyi October 29, 2026 07:22
@fengmk2
fengmk2 merged commit 7073d61 into voidzero-dev:main Oct 29, 2026
74 checks passed
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 this pull request may close these issues.

Nushell completers in env.nu use the deprecated positional completer input

3 participants