Native GitHub Copilot inline completions

Đang mở
#2,181 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/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ệ
github, node.js, swift
Lĩnh vực
ai, desktop, devtools

Hướng nghiên cứu

Bắt đầu bằng cách đọc CodeFileDocument và CodeFileView, sau đó lần theo các điểm vào của CopilotClient, CopilotService, CopilotProtocol, CopilotInlineCompletionProvider và CopilotBinaryResolver. Kiểm tra các phiên bản dependency của CodeEditTextView và CodeEditSourceEditor rồi chạy ứng dụng với các branch cục bộ đã được ghi lại. Hoàn tất có nghĩa là các package pin hỗ trợ việc tích hợp, CI build thành công, và luồng đăng nhập Settings cùng văn bản ma được chấp nhận bằng Tab hoạt động từ đầu đến cuối.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

Add native GitHub Copilot inline completions to CodeEdit: as you type, the editor shows AI ghost text suggestions and accepts them with Tab. This is the app-level integration that ties together the inline suggestion rendering (CodeEditTextView) and the inline completion coordination layer (CodeEditSourceEditor).

What it adds:

  • A Copilot language-server client and service (CopilotClient, CopilotService, CopilotProtocol) that launches and talks to the official copilot-language-server over LSP, including device-flow sign-in, status, and document sync.
  • A per-document CopilotInlineCompletionProvider that conforms to the editor's InlineCompletionDelegate, maps the caret to an LSP position, requests completions, strips already-typed prefixes, and adapts results into the editor's ghost-text model.
  • A CopilotBinaryResolver that locates copilot-language-server (explicit path, PATH, or common install dirs) and builds a launch environment that can find node (including nvm-managed installs), since the server is a Node script.
  • A Settings page (enable toggle, device-flow sign-in UI, optional language-server path) and a status bar item reflecting Copilot state.
  • Wiring in CodeFileDocument / CodeFileView to attach the provider per open document.

Design notes:

  • Suggestions render as ghost text via the CodeEditTextView overlay primitive and never mutate the document until accepted.
  • Disabled by default; opt-in via Settings. Requires a GitHub Copilot subscription.
Alternatives Considered
  • A plugin/extension instead of a built-in. CodeEdit does not yet have an extension API surface for inline completions, and the integration needs the editor's cursor/lifecycle hooks, so a built-in (opt-in, behind settings) is the practical option today.
  • Driving the suggestion lifecycle in the app rather than the editor. Rejected; the request/accept/dismiss lifecycle lives in CodeEditSourceEditor (see the dependency below), and the app only supplies a concrete provider.
Additional Context

This is the top layer of a three-repo change for native inline completions:

  1. CodeEditTextView: inline suggestion (ghost text) rendering primitive (CodeEditApp/CodeEditTextView#124, PR CodeEditApp/CodeEditTextView#125).
  2. CodeEditSourceEditor: inline completion coordination layer (CodeEditApp/CodeEditSourceEditor#374, PR CodeEditApp/CodeEditSourceEditor#375).
  3. CodeEdit (this issue): the GitHub Copilot provider and UI.

I have a working, documented implementation. Locally it builds and runs against the two dependency branches via a workspace that references local checkouts, and I have verified end to end against the real copilot-language-server (device-flow sign-in and inline ghost text that accepts with Tab). The package pins for CodeEditTextView / CodeEditSourceEditor need bumping to the releases that include layers 1 and 2 before this can build in CI. Would the maintainers welcome native Copilot support in CodeEdit?

Screenshots

I will attach a screen recording of the device-flow sign-in and inline ghost text on the PR.

Ngôn ngữ chính
Swift
Star
23k
Fork
1.2k
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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CodeEditApp/CodeEdit

Tất cả issue của CodeEditApp/CodeEdit

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.