nushell / nushell/reedline

Allow completers to choose partial completions

Open
#971 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Right now, with partial completions enabled, Reedline will automatically complete the common prefix of the completer's suggestions. But some completers might be using super-smart algorithms that Reedline doesn't understand, or they might need to add quotes around the partial completions.

So, completers should have the option to also return an optional partial completion with its generated suggestions. It would be a string and a span, and if the user hits TAB or whatever, the given span would be replaced with the given string.

References

None right now, I think Zsh allows this though.

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 locating Reedline's completer interface and the code that computes or applies partial completions when TAB is pressed. Trace how suggestions and spans are currently represented, then define how an optional completer-provided string and span would be carried and applied. Done means completers can supply that replacement while existing automatic common-prefix completion continues to work.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.