Repository navigation
feat(completion): allow overriding half of the span in custom/external completer - #17049
Conversation
|
What does "half of the span" mean? Does this resolve #17046 or unrelated? |
Not related. |
| .get("end") | ||
| .and_then(|val| val.as_int().ok()) | ||
| .and_then(|x| usize::try_from(x).ok()); | ||
| // TODO: error on invalid spans? |
There was a problem hiding this comment.
We really should, but right now we can just log an error or something. I really should've done that in my PR. Not a blocker for this PR though
|
You've probably already thought of this, but I wanted to bring up that it's not unambiguous what the user intends when their completer provides only half a span. There's a few possibilities if
If we chose interpretation 1, we would have to error. I think interpretation 3 is the most sensible and useful. It's what most users would mean when returning half a span intentionally. But the disadvantage with that is that if someone provides an With this PR, in such a scenario, With interpretation 2, the completer's given To be clear, I'm not pushing for interpretation 2 here, just wanted to hear your thoughts. I don't have strong feelings either way but we need to make sure whatever we decide will be intuitive. |
|
We should have some sort of combined release notes btw mentioning both PRs. Can come up with it after this PR is merged though |
IMO, error on such cases without any completion makes most sense. I mean if we provide enough messages about the validity of spans, there should be no more ambiguity, right? But I'm not sure how we want the message to present, on the reedline menu or a ShellError? |
|
Yeah, erroring makes sense. As for how we want to present, it wouldn't be too bad to print a big in-your-face I do want to make it so that Reedline menus can display more than just suggestions. If we did that, we could have it display the error, then get rid of the error if the menu's deactivated. We'd also log errors so that the error isn't lost forever once the menu's deactivated. Either way, not a blocker for this PR. We can disallow this behavior later. I'll just merge this for now. |
|
Actually, never mind the release notes, if you think it's too inconsequential to be mentioned. But we do need to update the docs, I forgot to do that after my PR |
Yup, working on that now |
As commented here
CC @ysthakur
Release notes summary - What our users need to know
None. Should be covered by those of #15888
Tasks after submitting