-
Notifications
You must be signed in to change notification settings - Fork 200
feat: implement ghost text and generalize inline elements #767
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
base: main
Are you sure you want to change the base?
Conversation
Refactors the InlayHint system into a generic InlineElement architecture to support inline code completion. - Introduce `InlineElement` interface, `InlineElementContainer`, and `InlineElementRenderer` - Implement `GhostText` and `GhostTextRenderer` for displaying completion suggestions - Add `InlineCompletionProvider` API and `requireInlineCompletion` in `Language` - Update `CodeEditor` to support `setInlineCompletionProvider` and handle Tab key to accept ghost text - Refactor `TextRow`, `LineBreakLayout`, and `WordwrapLayout` to use `InlineElement` instead of `InlayHint` - Adapt `InlayHintRenderer` to extend the new `InlineElementRenderer` - Add `GHOST_TEXT_FOREGROUND` to `EditorColorScheme`
No, currently it only supports single line completions. It can be extended to support multiline completions.
It is not necessary now, but when I created that function I was added all editor's event listeners in that function but later I used
It is absolutely possible but I need to make some changes, currently editor only renders one |
|
Here are my thoughts about the changes to inlay hints and inline elements:
|



Refactors the InlayHint system into a generic InlineElement architecture to support inline code completion.
InlineElementinterface,InlineElementContainer, andInlineElementRendererGhostTextandGhostTextRendererfor displaying completion suggestionsInlineCompletionProviderAPI andrequireInlineCompletioninLanguageCodeEditorto supportsetInlineCompletionProviderand handle Tab key to accept ghost textTextRow,LineBreakLayout, andWordwrapLayoutto useInlineElementinstead ofInlayHintGHOST_TEXT_FOREGROUNDtoEditorColorSchemeScreencast.From.2025-12-02.23-26-42.mp4
Limitations