Inline completion (ghost text) coordination layer
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- swift
- Lĩnh vực
- developer-experience, tooling
Hướng nghiên cứu
Bắt đầu trong TextViewController của CodeEditSourceEditor và đọc primitive kết xuất đề xuất inline trong CodeEditTextView, sau đó xem xét API InlineCompletionDelegate và InlineCompletionItem được đề xuất. Chạy các unit test hiện có bằng quy trình xcodebuild clean test đã được ghi lại; được xem là hoàn thành khi yêu cầu, hiển thị, chấp nhận, loại bỏ, chuyển vòng, kiểm soát Tab và việc xóa do con trỏ/chỉnh sửa hoạt động như mô tả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Swift
- Star
- 720
- Fork
- 162
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CodeEditApp/CodeEditSourceEditor
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CodeEditApp/CodeEditSourceEditor#376 · 1 bình luận ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 bình luận ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của CodeEditApp/CodeEditSourceEditor
Issue tương tự
-
The correction-threshold rationale says 17 restraint cases collide; the current corpus has 16 Đang mởarea:dictation documentation P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
uttrflow/uttrflow-swift#1180 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
OneBusAway/onebusaway-ios#1451 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100