intitni / CopilotForXcode

The missing GitHub Copilot, Codeium and ChatGPT Xcode Source Editor Extension
https://copilotforxcode.intii.com
MIT License
7.62k stars 372 forks source link

feature: add support for Codeium chat #485

Closed 4nalog closed 3 months ago

intitni commented 5 months ago

Wow, I was also planning to do this in the next phase when the chat feature is upgraded, but pull requests are always welcomed.

Do you mind explaining how Codeium chat will be integrated in this pull request?

khou22 commented 5 months ago

Wow, I was also planning to do this in the next phase when the chat feature is upgraded, but pull requests are always welcomed.

Do you mind explaining how Codeium chat will be integrated in this pull request?

Kevin from the Codeium team here. We are going to be bringing Codeium Chat to Xcode! @etaldot is implementing this right now and will be opening PRs in the next week. How it works at a high level:

  1. Language server has two process that we will enable: web socket server and chat web client bundle
  2. The web client bundle will be served on a free port and will be embedded via iFrame or browser window. This will connect to the web socket server.
  3. In future PRs, there will be links, inline buttons, etc. that will enable users to click a "Code Lens" above a function definition to explain a piece of code. This will send a request to the web socket server and the result will be streamed to any open chat clients.

Let me know if you have other questions! We're excited to be releasing this soon 🙂

intitni commented 4 months ago

Hello, is there any plan in continuing this pull request? If so, please rebase on the develop branch since there are several changes affect this pull request.

  1. The CodeiumService is now held by the CodeiumWorkspacePlugin so you don't need SuggestionWorkspacePlugin to access the language server. To access the plugin, you need to get the current workspace URL from XcodeInspector, get the workspace for the URL from workspacePool and get the plugin from the workspace.
  2. The open chat command is now handled in PseudoCommandHandler.openChat. You can add a new OpenChatMode and handle it there.
  3. In CodeiumExtension.extensionUsageDidChange, maybe you want the language server to stay alive when the open chat mode is set to the new option. You can use UserDefaultObserver to track the changes of the open chat mode.
intitni commented 3 months ago

Hello, since it has been quite a while so I am going to manually merge this branch into merging-codeium-chat then into develop.