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

Use decorations instead of inserts? #28

Open
tmcw opened this issue Jun 5, 2024 · 1 comment
Open

Use decorations instead of inserts? #28

tmcw opened this issue Jun 5, 2024 · 1 comment

Comments

@tmcw
Copy link
Member

tmcw commented Jun 5, 2024

So right now this plugin works by inserting real code into your text editor. This is basically inherited from the implementation in modeling-app. The pro of this is that the 'ghost text' gets proper syntax coloring and behaves like real code. The con is that when we insert ghost text, it generates real change events, so the actual code in the editor changes when you have ghost text displayed. So you can get into situations like:

  1. You're editing some text
  2. You end a line of text with something
  3. Codeium feels like it has a good suggestion to show you
  4. The suggestion is displayed briefly
  5. You close the tab
  6. When you re-open the tab, the ghost text is shown as "unsaved changes that were recovered" (if you have a recovery system)

This is obviously less than ideal, and ends up with (in our case) having a method exposed like shouldTakeUpdate which lets upstream systems ignore change events. But the whole necessity of that shouldTakeUpdate method is driven just by the fact that ghost text is, surprisingly, real code in your editor.

@tmcw
Copy link
Member Author

tmcw commented Jun 6, 2024

Having slept on it, realizing that the extra benefit of the current system is that it works smoothly with multi-line insertions and decorations probably wouldn't.

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

1 participant