Repository navigation
Updates to use CompletionResult - #18671
Merged
Merged
Conversation
fdncred
marked this pull request as draft
July 19, 2026 18:49
fdncred
marked this pull request as ready for review
July 20, 2026 00:30
philocalyst
force-pushed
the
reedline-signature-update
branch
2 times, most recently
from
July 20, 2026 00:48
3e08813 to
d535096
Compare
philocalyst
force-pushed
the
reedline-signature-update
branch
from
July 20, 2026 00:53
d535096 to
92bfcdc
Compare
philocalyst
force-pushed
the
reedline-signature-update
branch
from
July 20, 2026 01:26
7ee1391 to
5ceb051
Compare
Contributor
|
Thank. Please update the PR to follow the PR template. |
fdncred
added a commit
that referenced
this pull request
Aug 2, 2026
Requires nushell/reedline#1136 Related PR (Builds ontop of): #18660 ## Description This is a follow-up to #18334 (non-blocking completions, merged) and #18671 (test-infra sync, merged). Those landed the async worker model (`CompletionResult` Fresh/Stale/Pending) but left... several issues unresolved. Sorry to all the folks who put up with that on the nightlies :( Overarching changes: - Across prompts we're using a LRU cache for storing and managing the caches. This is configurable, and default bounded to 100. For many completions nothing is loaded onto the LRU cache, only the intensive operations (git checkout, carapace stuff, etc.). Open to dramatically reducing this number, but it *sure* feels nice when it works. - Cache work is a lot more robust, we do narrowing and carry always an "env" for the completor environment, so we have a *rough* idea of when to complete for the sources that are mostly pure. - Added completionengine for the death of hardcoded dispatch with a routing enum. This allowed me to rewrite the completor trait around the context and fetched types, wiring a lot more logic directly through it. - Added completionsite and sitekind models for a catch-all way for resolving the facts of what is under the cursor, which kills maybe fifty sites of span math (what caused the super annoying completion duplication) - *commandline complete --type` now type-checks its argument (previously accepted any string and could silently no-op) and clamps the cursor to a valid boundary instead of indexing out of range. - complete paths is shared between file and directory completions, which eliminates a panic risk and more manual span constructions. - - **Flag/span plumbing.** `FlagRef` and `Flag::long_name` are adopted across `nu-parser`/`nu-engine`/`nu-cmd-lang` so flag identity survives through parsing and into completion and help-text rendering, which eliminated a lot of re-derive logic. ## User-facing changes (Release notes) - Added `$env.config.completions.cache_size` (default: `100`) to control that cap. - Completion results now persist across prompts instead of being discarded on every new prompt,. - Fixed a potential panic when narrowing file/directory completions on a path containing multi-byte (non-ASCII) characters. - `commandline complete --type` now validates its `--type` argument and no longer panics on an out-of-range cursor. - `use`, `overlay use`, `export use`, `source-env`, `hide-env`, `attr complete`, and `which` now go through the same completion dispatch as other builtins, fixing inconsistent/missing completions in a few of them ## Additional Notes - Can't promise that this eliminates all bugs, just most of them. The bigger thing it gives us is a more robust framework to fix bugs, going forward. Will be responsive to anything related to completions, and am okay with a longer review period before merge. The big things are covered now, however, with the added tests in this PR. - fixes #11211 --------- Co-authored-by: Darren Schroeder <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR modernizes and refactors the REPL parser and completion test suite!
CompleterExt) to integrate completion patterns directly into Nushell core test utilities.User-facing changes (Release notes)
n/a