Unnecessary completion request when updating the common prefix to the command line.
Open
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
}
foo <tab>returns those 2 items with the common prefix"- Reedline updates the line text to
foo " - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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