nushell / nushell/reedline

Unnecessary completion request when updating the common prefix to the command line.

Open
#964 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Completions bug P-low
Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

From https://github.com/nushell/nushell/issues/16860, we can tell that there's something to optimize.

Steps to reproduce


def completion [] {
  ['"first item"' '"second item"']
}

export def foo [c: string@completion] {
  print $c
}

  1. foo <tab> returns those 2 items with the common prefix "
  2. Reedline updates the line text to foo "
  3. During menu redraw (maybe?), the completion results are updated to those for the new text foo ", which is totally unnecessary in theory.

It could potentially be a dealbreaker for time costing external completer.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Nushell completion example and trace Reedline's completion and menu-redraw flow after the common prefix changes. Identify where the updated line triggers another completion request, then verify that the existing results are not requested again when the prefix update does not require new results.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.