-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggestion: added display #692
base: main
Are you sure you want to change the base?
Conversation
5826d06
to
5e7a9ea
Compare
@stormasm this one can be tested with nushell/nushell#11444 |
@rsteube @fdncred Thanks for bringing this one up to speed too... |
Yeah, i ran into that as well (duh!). Didn't expect that the patching does not work for the transitive dependency. |
Now that I think about this some more I am hesitant to add another field to Suggestion... Why not just use the pub extra: Option<Vec<String>>, extra instead ? It can be viewed as kind of an additional (generic) location to grab stuff from ? And then you can just grab your display value from the first item in the extra vector. And the end user of Carapace has no idea where that data is coming from anyway right ? Thoughts on this... |
Yeah I think there might be some misunderstanding. Truncating isn't really an option. Fish does this and it gives awful results as it can't know where to make the cut. The string vector |
Thanks for helping me understand the problem better... So if "extra" was called "display" but we kept it a Vector like it is right now would that work ? instead of this... /// Optional display value for the replacement
pub display: Option<String>, do it this way... pub display: Option<Vec<String>>, Or to phrase it another way
Do the completion scripts care whether they are passing a String or a Vector of Strings ? |
Can't really make much sense of the vector here. What is it for? |
@fdncred |
I guess what I am saying is that if you think about the Suggestion as a Container in which to pass Where the end user of the Suggestion may have different needs in their application The Style PR that we landed yesterday and this Display PR currently could have been represented I believe that was the intention of the "extra" field in the first place..... Because other applications will come along later and want other stuff in their Suggestions possibly... But I could be wrong --- why is extra there anyway ---- what can it be used for ? Is it named properly ? |
@rsteube Are you still wanting to move forward with this? |
Sure, but how do you want to go forward with it? |
I think it's fine with the display member of the suggestion structure, but we don't want to have breaking changes either. @stormasm may have different suggestions. |
@rsteube I am fine with moving forward with this PR as well... |
1f89ec3
to
a5e0b9f
Compare
a5e0b9f
to
4949025
Compare
I'll probably be ok with this PR once I can see it work and understand if there are bugs or not. I can't get the nushell PR that references this PR to work. So, I'm glad these are draft. I'm also a tiny bit concerned that this is another breaking change. |
Full inserted value:
Display value:
TODO
related nushell/nushell#5292
needs #691