Inline completion (ghost text) coordination layer
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 32/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- swift
- Bereich
- developer-experience, tooling
Rechercherichtung
Beginne in CodeEditSourceEditor’s TextViewController und lies das Inline-Vorschlagsdarstellungsprimitive in CodeEditTextView, anschließend überprüfe die vorgeschlagene InlineCompletionDelegate- und InlineCompletionItem-API. Führe die vorhandenen Unit-Tests mit dem dokumentierten xcodebuild clean test-Ablauf aus; als erledigt gilt es, wenn Anforderung, Anzeige, Annahme, Verwerfen, Wechseln, Tab-Steuerung und das Löschen durch Cursor-/Bearbeitungsänderungen wie beschrieben funktionieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
Add an inline completion (ghost text) coordination layer to CodeEditSourceEditor, built on the inline suggestion rendering primitive in CodeEditTextView. This gives the editor a provider-agnostic way to request, show, accept, cycle, and dismiss inline AI suggestions (the GitHub Copilot UI pattern).
Proposed API:
InlineCompletionDelegate: a@MainActorprotocol a host conforms to.inlineCompletionsRequested(textView:cursorPosition:) async -> [InlineCompletionItem]returns suggestions; optionalinlineCompletionDidShow/Accept/Dismisshooks report lifecycle.InlineCompletionItem: the suggestion model (insert text plus the range it applies to).TextViewControllermethods:requestInlineSuggestion()(debounced),setInlineSuggestions(_:selectedIndex:),acceptInlineSuggestion(),dismissInlineSuggestion(),selectNext/PreviousInlineSuggestion().- Behavior: requests are debounced and skipped while the completion popup is visible (ghost text and popup never co-exist); Tab accepts when a suggestion is active; moving the cursor or editing dismisses the ghost text.
Alternatives Considered
- Putting this logic in the app target (
CodeEdit) directly. Rejected because the request/accept/dismiss lifecycle is tightly coupled to the editor's cursor, selection, and key handling, which live here. Keeping it inCodeEditSourceEditorlets any host provide completions through a small delegate, rather than each host re-implementing the lifecycle. - Mutating the document to preview suggestions. Rejected; the underlying
CodeEditTextViewprimitive renders ghost text as an overlay without touching text storage, so previews never pollute undo or layout.
Additional Context
This is the middle layer of a planned native inline-completion feature for the CodeEdit stack: CodeEditTextView provides the rendering primitive (CodeEditApp/CodeEditTextView#124), CodeEditSourceEditor (this issue) coordinates the lifecycle, and CodeEdit wires up a concrete provider such as GitHub Copilot.
I have a working, documented implementation with unit tests covering request/show, accept, dismiss, cycling, Tab-accept gating, and ghost-text clearing on cursor move and edit. It builds and tests pass via xcodebuild ... clean test (against the CodeEditTextView change above), and SwiftLint is clean. Would the maintainers welcome this in CodeEditSourceEditor?
Screenshots
The user-visible ghost text is shown by the app-level integration in CodeEdit; this layer is the coordination API and is covered by unit tests.
- Vorherrschende Sprache
- Swift
- Sterne
- 720
- Forks
- 162
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus CodeEditApp/CodeEditSourceEditor
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
CodeEditApp/CodeEditSourceEditor#376 · 1 Kommentar ·
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 Kommentar ·
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
Alle Issues in CodeEditApp/CodeEditSourceEditor
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
type: docs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
googleapis/google-cloud-swift#971 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Move wallpaper setting Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
manaflow-ai/cmux#13417 ·