Inline suggestion (ghost text) rendering primitive
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
Comece em CodeEditTextView e inspecione a geometria do caret e o caminho de layout/renderização; a issue não nomeia nenhum arquivo nem alvo de teste. Execute a suíte de testes existente xcodebuild clean test e o SwiftLint, depois verifique se a InlineSuggestion API renderiza overlays de uma e várias linhas sem alterar textStorage ou o estado de edição.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
Add a low-level rendering primitive to CodeEditTextView for inline "ghost text" suggestions: text drawn after the caret that previews content the user has not typed yet (the same UI pattern as GitHub Copilot, Xcode predictive completion, and similar inline AI suggestions).
The proposed API is small and rendering-only:
- A
InlineSuggestionvalue type (a documentoffsetplus thetextto show, which may be multi-line). TextView.setInlineSuggestion(_:at:),TextView.setInlineSuggestion(_:)(anchored at the primary caret), andTextView.clearInlineSuggestion().
Key design point: a suggestion is purely a rendering hint. It is drawn as a sibling overlay anchored at the caret and never mutates textStorage or shifts real text layout, so it cannot corrupt the document or interfere with editing, undo, or selection. This keeps the primitive safe and makes it a clean foundation that higher layers can drive.
Alternatives Considered
- Inserting the suggestion as real (styled) text and removing it on reject. Rejected because it mutates the text storage, pollutes undo, and risks desyncing layout and selection.
- Building the feature entirely in a downstream package. Rejected because the caret geometry and layout information needed to position ghost text correctly live in
CodeEditTextView, so the rendering primitive belongs here. Higher-level packages should only decide what text to show and when.
Additional Context
This is intended as the foundation for native inline AI completions (for example GitHub Copilot) in the CodeEdit stack: CodeEditTextView provides the rendering primitive, CodeEditSourceEditor coordinates request/accept/dismiss, and CodeEdit wires up the provider. This issue covers only the CodeEditTextView rendering layer.
I have a working, documented implementation with unit tests (overlay rendering, multi-line suggestions, and a check that the suggestion never mutates text storage). It builds and tests pass via xcodebuild ... clean test, and SwiftLint is clean. I am happy to open it as a PR for review. Would the maintainers welcome this in CodeEditTextView?
Screenshots
This layer is a non-visual API primitive; the user-visible ghost text appears once a higher layer drives it. The rendered result can be shown in the downstream CodeEditSourceEditor / CodeEdit integration.
- Linguagem predominante
- Swift
- Estrelas
- 182
- Forks
- 57
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de CodeEditApp/CodeEditTextView
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
CodeEditApp/CodeEditTextView#121 ·
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 28/100
CodeEditApp/CodeEditTextView#119 ·
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
CodeEditApp/CodeEditTextView#106 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
-
enhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
Todas as issues de CodeEditApp/CodeEditTextView
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
manaflow-ai/cmux#13763 ·
-
type: feature request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
googleapis/google-cloud-swift#1036 · 1 comentário ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
wultra/mtoken-sdk-ios#253 ·
-
The correction-threshold rationale says 17 restraint cases collide; the current corpus has 16 Abertaarea:dictation documentation P2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
uttrflow/uttrflow-swift#1180 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100