refactor(completion): move NuMatcher from nu-cli to nu-protocol#17757
refactor(completion): move NuMatcher from nu-cli to nu-protocol#17757blindFS wants to merge 5 commits intonushell:mainfrom
Conversation
|
Hey, just a bot checking in! You edited files related to the configuration. |
|
I'm wondering if we should go so far as to move NuMatcher into Reedline. After all, it's not really specific to Nushell |
|
Please take care of the failed security audit check, looks like this uses dependencies that need to be updated/replaced? https://github.com/nushell/nushell/actions/runs/22882189266/job/66387247251?pr=17757 |
Co-authored-by: Yash Thakur <45539777+ysthakur@users.noreply.github.com>
Seems addressed by #17765 |
As I commented here, my ideal way of handling matching while typing would require NuMatcher on both sides. But if the candidates aren't too many |
This PR serves as the preparation work for some follow-up PRs that implement a parameter-level dynamic completer.
As discussed in #16859, something like:
will make the life a lot easier.
I believe it's actually feasible with the trick of
#[typetag::serde(tag = "type")]and dyn-clone.So there’s going to be quite some refactoring. To make it easier to review, I think I'll try to break it into small PRs.
In order to make parameter-level completers only return results that match the user input, IMO
NuMatcheris best suited innu-protocol/src/completion/matcher.rs, hence this PR. @ysthakurRelease notes summary - What our users need to know
Nothing
Tasks after submitting
DotNuCompletion,ExportableCompletion,CommandCompletion... implement the traitArgumentCompleterand move them tonu-protocol/src/completionuse/export use/which/attr complete/...right in the signature definitionget_dynamic_completionrelated stuff introduced in Plugin: support custom completions in command flags #16859 and fix(completion): path/directory/glob typed flag values get empty completion results #17006foo: string@"builtin exportable"