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

[Bug]: Can't accept suggestions #491

Closed hedgemanNate closed 3 months ago

hedgemanNate commented 5 months ago

Before Reporting

What happened?

Slight variation on a known issue.

Copilot stopped allowing me to accept its suggestions. Nothing would type when I clicked "Accept" or when I pressed tab. However, I would have to click back on to Xcode to continue typing.

This began after the last update.

After reading similar issues, I tried suggested solutions. I also tried the solutions in the FAQ. None worked for me.

What endup up simi-working was turning on the 'Always accept suggestion with Accessibility API' toggle. I can accept suggestion now, however now when I do, the page scrolls to the top and then jumps back down to where I was typing. Which is fine, but I know that is not the intended function and it used to work as expected and without that toggle being on.

How to reproduce the bug.

Just use xcode with copilot on as normal, and wait for a suggestion.

Relevant log output

No response

macOS version

14.3

Xcode version

15.3

Copilot for Xcode version

0.32.0

intitni commented 5 months ago

Did you restart Xcode after updating the extension?

hedgemanNate commented 5 months ago

Did you restart Xcode after updating the extension?

Yes I did. Several times.

hedgemanNate commented 5 months ago

Also to clarify, when I type TAB to accept the suggestion the page does just jump and does not return to where I was typinp.

intitni commented 5 months ago

Please check that the menu Editor > Copilot in Xcode menubar exists and is not greyed out. If it doesn't exist, you can try re-enabling the Xcode source editor extension.

Please also make sure that there is no another copy of Copilot for Xcode exist on you mac.

hedgemanNate commented 5 months ago

There is no other copy on my mac and the Copilot menubar item is not greyed out.

intitni commented 5 months ago

What about turning off “trigger command with accessibility api” from the advanced settings?

hedgemanNate commented 5 months ago

If I turn that off, accepting suggestions do not work at all. However I will try it again now. Because I know how bugs can be intermittent.

hedgemanNate commented 5 months ago

Nope, with trigger command with accessibility api toggled off, it does not accept suggestions at all.

intitni commented 5 months ago

Can you accept suggestion by clicking the accept suggestion menu item in Editor > Copilot or triggering it with a key binding?

hedgemanNate commented 5 months ago

Neither works.

intitni commented 5 months ago

I think the source editor extension fails to communicate with the service app. Please

  1. Go to System Settings.app > General > Login Items and remove Copilot for Xcode.app from the "Allow in the Background" list.
  2. Quit and restart Copilot for Xcode.app, it should install the login item again, if it doesn't, click "Set up launch agent".
  3. Restart the Mac as the extension seems to be talking to a deleted version of the service app, which looks like a macOS bug.
hedgemanNate commented 5 months ago

For step 2, I get the error: "The operation couldn't be completed. Operation not permitted." I'll restart my mac for good measure.

hedgemanNate commented 5 months ago

The issue is the same.

The Copilot app now says Extension Service and Accessibility Permission are loading. And the refresh button is greyed out. Screenshot 2024-04-16 at 9 34 49 PM

intitni commented 5 months ago

Please try setting up the launch agent manually following this FAQ section

hedgemanNate commented 5 months ago

Ok. I will give it a shot tomorrow. It's late where I am. Thank you so much for your help tho. I will update here what happens.

nrbrook commented 5 months ago

I have a similar issue, I can accept suggestions with the buttons but not with tab. Seems to be a new issue since the latest update (as far as I have noticed). I have followed the suggestions above with the same issues. Can't get it working again without re-enabling the "allow in background" setting in login items (I tried setting up manually).

intitni commented 5 months ago

@nrbrook Sorry I can't get my head around your statement. Is it working again or still not working?

The button and tab basically do the same thing. Could you please check if the Plus license is still activated in the Plus tab? I have heard some users losing their license after an update but I honestly don't know why.

nrbrook commented 5 months ago

I mean to get it working at all, I have to keep "allow in background" enabled (manual install doesn't work). But tab isn't working.

It is still activated.

Screenshot 2024-04-18 at 15 59 01
nrbrook commented 5 months ago

Nevermind, it works after a reboot

intitni commented 5 months ago

@nrbrook You are having a different issue. Please open Console.app, click start streaming and set the filter to

category:Service any:CopilotForXcodeExtensionService

Let me know if you see the following logs when you activate an Xcode window:

Screenshot 2024-04-18 at 23 08 59
nrbrook commented 5 months ago

Will do if it happens again

intitni commented 5 months ago

@nrbrook Great. It's probably a macOS bug.

@hedgemanNate I did some experiments and found that to reinstall the launch agent, you need to:

  1. Delete Copilot for Xcode.app, make sure it's also not in the trash bin.
  2. Restart Mac, so that it will clean the list up.
  3. Install the app again in the Applications folder.
nrbrook commented 5 months ago

@intitni It happened again when I updated to the latest version. It seems like updating breaks it and requires a restart to fix.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 3 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.