Native GitHub Copilot inline completions
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
调研方向
先阅读 CodeFileDocument 和 CodeFileView,然后跟踪 CopilotClient、CopilotService、CopilotProtocol、CopilotInlineCompletionProvider 和 CopilotBinaryResolver 的入口点。检查 CodeEditTextView 和 CodeEditSourceEditor 的依赖版本,并使用文档中记录的本地分支运行应用。完成的标准是:包固定版本支持该集成,CI 构建成功,并且 Settings 登录流程和通过 Tab 接受的幽灵文本能够端到端工作。
由索引模型根据 Issue 内容生成。
描述
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 officialcopilot-language-serverover LSP, including device-flow sign-in, status, and document sync. - A per-document
CopilotInlineCompletionProviderthat conforms to the editor'sInlineCompletionDelegate, maps the caret to an LSP position, requests completions, strips already-typed prefixes, and adapts results into the editor's ghost-text model. - A
CopilotBinaryResolverthat locatescopilot-language-server(explicit path,PATH, or common install dirs) and builds a launch environment that can findnode(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/CodeFileViewto attach the provider per open document.
Design notes:
- Suggestions render as ghost text via the
CodeEditTextViewoverlay 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:
CodeEditTextView: inline suggestion (ghost text) rendering primitive (CodeEditApp/CodeEditTextView#124, PR CodeEditApp/CodeEditTextView#125).CodeEditSourceEditor: inline completion coordination layer (CodeEditApp/CodeEditSourceEditor#374, PR CodeEditApp/CodeEditSourceEditor#375).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.
- 主要语言
- Swift
- 星标
- 23k
- 派生
- 1.2k
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CodeEditApp/CodeEdit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
CodeEditApp/CodeEdit#2190 ·
-
难度 1/5 1 小时以内 新手友好度 15/100
CodeEditApp/CodeEdit#2195 · 5 个 reaction ·
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
CodeEditApp/CodeEdit#2185 ·
-
bug
难度 4/5 3-5 天 新手友好度 35/100
CodeEditApp/CodeEdit#2180 ·
-
bug
CodeEditApp/CodeEdit#2174 · 1 条评论 · 已指派 1 人 ·
查看 CodeEditApp/CodeEdit 的全部 Issue
相似的 Issue
-
area:dictation documentation P2
难度 2/5 1-3 小时 新手友好度 78/100
uttrflow/uttrflow-swift#1180 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 84/100
OneBusAway/onebusaway-ios#1451 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100