Making Reedline aware of the status of completors#1123
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Reedline’s completion pipeline so the engine and menus can distinguish between pending, stale, and fresh completion results, enabling menus to avoid rendering “empty” states while background completion work is still in flight (reducing UI flashing/jumping).
Changes:
- Introduces
CompletionResult/CompletionStatusand updates theCompletertrait to report completion lifecycle state. - Updates the engine loop to poll completer background work and refresh active menus when results become ready.
- Refactors IDE/columnar menu completion rendering to cache suggestion display metrics and to suppress empty-state rendering while awaiting results.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/menu/menu_functions.rs | Adds CompletionDisplay to cache suggestions and derived display metrics for menus. |
| src/menu/list_menu.rs | Updates completion call site to the new CompletionResult API. |
| src/menu/ide_menu.rs | Adopts CompletionDisplay and adds pending-aware rendering to avoid “no records” flashing. |
| src/menu/description_menu.rs | Updates completion call site to the new CompletionResult API. |
| src/menu/columnar_menu.rs | Adopts CompletionDisplay, adds pending-aware rendering, and refactors suggestion string formatting. |
| src/lib.rs | Re-exports new completion lifecycle types (CompletionResult, CompletionStatus, Suggestions). |
| src/engine.rs | Polls completion status each loop iteration and refreshes active menus when ready. |
| src/completion/mod.rs | Re-exports new completion lifecycle types from base. |
| src/completion/history.rs | Updates history completer implementation to return CompletionResult. |
| src/completion/default.rs | Updates default completer implementation and docs to return/use CompletionResult. |
| src/completion/base.rs | Adds Suggestions (Arc-backed), CompletionResult, CompletionStatus, and updates Completer trait signatures. |
| examples/persistent_menus.rs | Updates example completer implementation to return CompletionResult. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Nice! |
|
Responded to comments and made more efficent with stronger use of Arced suggestions ! |
|
ok, let's continue to push forward @philocalyst to get these completions in good order. appreciate your help. |
- This syncs against the changes made in reedlines [changes](nushell/reedline#1123). - This consolidates signatures and makes the code more readable and obvious. - Also removes things like CompleterExt to pull more of this new tech into the "core" of nu.
Summary
Before
After
Additional notes
create_string-- where I got both paths down to one/two allocations