-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Partial acceptance of Inline suggestions skips command
#172384
Comments
@bmuskalla thanks for opening this issue. What Some ideas to workaround the challenges: Let me know what are your suggestions @bmuskalla @hediet |
No user impact from the command (at least not this point) but for us to decide whether we cache things, keep track of good/bad suggestions, trigger async operations that influence the next completion. While we could compute the changes between the old document and the new one to figure out what happend, it would not tell us if things got partially accepted or typed-as-suggested. Certainly sounds like a possibility to track this. I think I'd have hoped to have a similar callback for partial acceptance as we have for acceptance. |
With the current events, I don't actually think this would be plausibel as the next shown events (after a partial acceptance) don't have enough information/we'd have to somewhere keep the state about lastShown==partially accepted. Especially in multi-line scenarios this is really tricky to capture. It would be great to get your sentiment on |
I think that is reasonable. What do you think @jrieken? |
Yeah, enriching and calling handleDidShowCompletionItem makes most sense. I really not try to reverse engineer partial acceptance based on change events because that's cumbersome and error-prone. |
@bmuskalla Is this something you urgently need? I am asking because we are wrapping up the January release and we will likely ship that without any improvement for you. |
This is indeed urgent for us as it prevents us from tracking which suggestions got accepted by the user; which is a core quality metric for Copilot. If we can agree on a design, I'm also happy to see it I can provide a PR for this |
How about an additional argument to the |
For me, the question is if
This could replace
I think in this case when a user accepted a partial completion, it should be handled as partial completions until the suggestion is done/session is ended. |
@bmuskalla It would be awesome if you could try this out once both PRs landed and we have a new build! |
Latest insider build just missed this by one commit :) I'll try to set this up locally. Can we expect a new insiders build every night? Or can this be triggered manually? Also question regarding the API: Right now, you only pass the length of the back insertion back to the providers. What are the usecases for not passing along the range? I see you resolve the range against the document. For our purposes, we also want to track the offset at which the suggestion was inserted (and I should be able to compute that with |
I just thought the length would be more self-containing, than a range of the newly inserted text. |
Just to clarify - Insiders is realeased every day, but this week is special because we are preparing for a stable release - so Insiders is frozen. But I do expect us to have the insiders with this fix out soon. The fix that @hediet linked will also be part of the stable release that is going out in 2 days. @bmuskalla so the important thing is to figure out if the current solution is good enough for stable, and we are of course open to iterate on the solution so we fine-tune it in Insiders and for the next Stable release (start of March). |
@bmuskalla as part of endgame (#174828), I'd like to confirm whether the issue has been resolved for you? |
@rzhao271 Thanks for checking, we're all good on this one. |
Commit: 0a6c277
Steps to Reproduce:
InlineCompletionItemProvider
InlineCompletionItem
s with acommand
to be called after the suggestion was acceptedFew problems that arise from this:
a) even if you fully accept a suggestion, the provider will never know about this
b) providers don't know if a suggestion was partially or fully accepted (relevent for tracking quality metrics)
c) accepting a completion using partial acceptance leads to a very different lifecycle of shown/accepted events
Example:
foo.bar(xxx);
foo
bar(
xxx);
handleDidShowCompletionItem
is called for each part that is accepted, whilecommand
is never executed (even after the lastxxx);
got accepted.// cc @isidorn @hediet
The text was updated successfully, but these errors were encountered: