Inline completion (ghost text) coordination layer
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 32/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- swift
調査の方向性
CodeEditSourceEditor の TextViewController から始め、CodeEditTextView にあるインライン候補の描画プリミティブを確認し、その後、提案されている InlineCompletionDelegate および InlineCompletionItem API をレビューします。文書化されている xcodebuild clean test のフローで既存のユニットテストを実行します。リクエスト、表示、受け入れ、破棄、サイクル、Tab の制御、カーソル移動・編集によるクリアが、説明どおりに動作すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Swift
- スター
- 720
- フォーク
- 162
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeEditApp/CodeEditSourceEditor のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
CodeEditApp/CodeEditSourceEditor#377 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
CodeEditApp/CodeEditSourceEditor#376 · コメント 1 件 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
CodeEditApp/CodeEditSourceEditor#378 · コメント 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
CodeEditApp/CodeEditSourceEditor の issue をすべて見る
似ている issue
-
area:dictation documentation P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
uttrflow/uttrflow-swift#1180 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
type: docs
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
googleapis/google-cloud-swift#971 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mozilla-mobile/firefox-ios#35743 ·