Closed as duplicate
Closed as duplicate
Description
At the moment the inlineCompletionProvider signals when a completion has been shown to the user via didShow callback.
Unfortunately there is not a clear signal that a suggestion has been hidden/removed from screen (after it has been shown), that would be sent back to the provider. This makes it hard to track explicit rejections on shown suggestions. (Note that if relying only on the shown event + accepts, we might miss out on certain rejections )
Looking at the actual solution there are few easy ways how this can be achieved.
- Respond back via the
handleItemDidShow
with empty insertText if there is lastCompletion, but no currentCompletion. (Although this then requires handling in the provider, to make sure that no empty suggestions are sent, otherwise this could be misleading, though there is a low likelyhood of that happening) - Respond back via the
handleItemDidShow
with undefined insertText (This would require changes in multiple places, and although it would make the behavior more understandable, I am not sure its needed) - Create a new
handleItemDidHide
callback on the provider, which could also carry additional information about why the completion was hidden (cursor move/esc/new suggestion proposed/dropdown option selected)
I am also happy to contribute any of the changes.