Skip to content

Feature request: Inline virtual text for suggestions #328

Closed
@cpmsmith

Description

@cpmsmith

Neovim 0.10 has been out for a while now, with support for virt_text_pos = "inline", i.e. virtual text which is visible in the middle of text, leaving the text in the buffer at its position visible instead of replacing it, in the style of LSP inlay hints.

It would be nice if copilot.lua used inline virtual text to display suggestions, as currently suggestions in the middle of a line obscure what remains on the line. This very often causes confusion around things like auto-pairs, e.g. in this example:

Screenshot 2024-10-24 at 12 16 17

If I dismiss the suggestion, I can see that the opening bracket has been auto-paired, but I have no way to tell while the Copilot suggestion is active.

Screenshot 2024-10-24 at 12 16 28

And if I accept the suggestion, it appears as though the closing bracket was added by Copilot, even though it didn't appear in the suggestion.

image

This is all much more noticeable if there is more than one remaining character on the line, e.g. when replacing the first argument of multiple in a function call, the suggestion may cover up the existing values for the following arguments.

Notes

  • In this example, when I did accept the suggestion, it actually moves my cursor after the closing bracket. Does that mean that the closing bracket is actually part of the suggestion and is being hidden, or automatically made to not conflict somehow?
  • Can inline virtual text have multiple lines?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions