Skip to content

Inline Completion provider should signal when a completion has been hidden #192546

Closed as duplicate
@marrej

Description

@marrej

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.

  1. 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)
  2. 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)
  3. 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions