Repository navigation
Allow custom/external completers to override display value - #17330
Merged
Merged
Conversation
ysthakur
commented
Jan 11, 2026
| impl NuMatcher<'_, SemanticSuggestion> { | ||
| pub fn add_semantic_suggestion(&mut self, sugg: SemanticSuggestion) -> bool { | ||
| let value = sugg.suggestion.value.to_string(); | ||
| let value = sugg.suggestion.display_value().to_string(); |
Member
Author
There was a problem hiding this comment.
This change currently doesn't do anything, but in the future, we'll start setting display_override. At that point, I think using the display value will be more sensible than using value (especially since the match_indices would have to apply to the displayed value).
Contributor
|
I noticed in this example $"(ansi red)foo(ansi green)bar(ansi blue)baz"there is no |
Member
Author
|
Yeah, nothing to worry about. We already add a reset after the value in both the columnar menu and the IDE menu (since before this display override stuff). This is what the example above looks like if you have several of the suggestions:
|
ysthakur
marked this pull request as ready for review
January 24, 2026 19:05
This was referenced Feb 20, 2026
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.

Make Nushell compile after nushell/reedline#1002 and allow custom/external completers to override display value.
This adds a new
display_overridefield to the suggestion record that completers can return.Release notes summary - What our users need to know
Custom and external completers will now be able to set a display value for their suggestions that's separate from the value that will be filled into the buffer. They can do this by creating suggestions with the
display_overridefield set. Thedisplay_overridefield is allowed to contain ANSI escapes for styling suggestions more extensively than thestylefield allows.def completer [] { [{ value: "foobarbaz", display_override: $"(ansi red)foo(ansi green)bar(ansi blue)baz" }] }Tasks after submitting
display_overridefield to avoid having Reedline deal with quotes - Set display_override and match_indices for file completions #17424