github / CopilotForXcode

Xcode extension for GitHub Copilot
MIT License
1.64k stars 25 forks source link

Copilot loses connection with Xcode #13

Open ipodishima opened 6 days ago

ipodishima commented 6 days ago

Describe the bug Hi there!

I'm using Xcode the following way: screens split in 2 within the same Xcode window, using the "add editor on right" button. For example, on the left, I have the unit tests file, and on the right, I have the file I'm testing. When I switch the right side to the unit tests file, I'll likely lose copilot, it will stop suggesting things. BTW, I'm losing connection from time to time, but other than this, I don't have real steps to help reproduce.

Being transparent here, this is an issue I had a lot with intitni.

The best way to fix it with the non official extension was to hit a button "Reactivate observations to Xcode" Before this feature, I had to relaunch the app and sometimes Xcode, so this shortcut saves some time. It's a bug, but also a feature request :)

Versions

Steps to reproduce See description

Logs In the following logs

github-copilot-for-xcode.log

devm33 commented 6 days ago

Hi @ipodishima thanks for trying out GitHub Copilot for Xcode and providing detailed feedback!

Looking through the log I don't see the Xcode observations failing. So far I'm not able to reproduce with the two editor setup (that is typically how I have my Xcode setup as well 😄)

In the latest pre-release, we added some additional visibility into the extension's current status via the menu bar icon. Would you mind updating to that and seeing if that sheds any light on the issue. We also have further improvements in this area in progress.

ipodishima commented 5 days ago

Hey @devm33

I updated to the latest pre release. I'm experiencing different things. First, the icon sometimes spins real quick but does not suggest anything (I'm trying to simply add comments as I know copilot should not fail on this).

I also had once the warning alert saying Xcode is using a degraded version to accept suggestion.

Finally, without doing something specific, I have this

Screenshot 2024-11-01 at 10 45 02

Obviously, the extension is enabled, and I did not perform specific operations like re installing, ...

Here are the logs

github-copilot-for-xcode.log

devm33 commented 5 days ago

Hi @ipodishima, thank you for sharing your log file. Looking in there I see Trigger menu item Editor/GitHub Copilot/Sync Text Settings failed: Sync Text Settings is not found. which would indicate that the extension is not active in Xcode or does not have permission to be. Can you check in the Xcode > Editor menu to see if GitHub Copilot is there.

If it's there but greyed out, then you need to restart Xcode to activate it. If it's not there, then you need to add GitHub Copilot as an Xcode Source Editor extension in System Settings > Privacy & Security > Extensions > Xcode Source Editor