Skip to content
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

Ghost text API support for Copilot-like functionality #11

Open
freref opened this issue Nov 12, 2024 · 1 comment
Open

Ghost text API support for Copilot-like functionality #11

freref opened this issue Nov 12, 2024 · 1 comment

Comments

@freref
Copy link

freref commented Nov 12, 2024

First of all, amazing work on the plugin system and Steel.
I'd like to build a Copilot-like plugin showing ghost/preview text suggestions in insert mode. Would need:

  • Ghost text display after cursor with different styling
  • Accept/reject suggestion functionality

Main questions:

  • Is there an existing API for ghost text?
  • If not, which codebase areas should I look at to implement this myself?

Before starting: would this kind of functionality be welcome in Helix?

@mattwparas
Copy link
Owner

Ghost text should be possible to build at the plugin layer, I don't think there is an API for it yet. In theory you'd just need the dimensions of the current buffer window so that you can draw text with a different style. The component API should be sufficiently flexible to do the displaying with styling, alongside handling inputs for accepting and rejecting the suggestion, and for inserting whatever text should go there as well

As far as I can tell, you wouldn't need much functionality in Rust to achieve this, just the dimensions of the buffer window, which is probably fine to expose to steel. Given that, I think it should be fine to go forward with an implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants