Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Can't accept suggestions #491

Open
2 tasks done
hedgemanNate opened this issue Apr 17, 2024 · 23 comments
Open
2 tasks done

[Bug]: Can't accept suggestions #491

hedgemanNate opened this issue Apr 17, 2024 · 23 comments
Assignees
Labels
bug Something isn't working

Comments

@hedgemanNate
Copy link

hedgemanNate commented Apr 17, 2024

Before Reporting

  • I have checked FAQ, and there is no solution to my issue
  • I have searched the existing issues, and there is no existing issue for my issue

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

@hedgemanNate hedgemanNate added the bug Something isn't working label Apr 17, 2024
@intitni
Copy link
Owner

intitni commented Apr 17, 2024

Did you restart Xcode after updating the extension?

@hedgemanNate
Copy link
Author

Did you restart Xcode after updating the extension?

Yes I did. Several times.

@hedgemanNate
Copy link
Author

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
Copy link
Owner

intitni commented Apr 17, 2024

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
Copy link
Author

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

@intitni
Copy link
Owner

intitni commented Apr 17, 2024

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

@hedgemanNate
Copy link
Author

hedgemanNate commented Apr 17, 2024

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
Copy link
Author

hedgemanNate commented Apr 17, 2024

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

@intitni
Copy link
Owner

intitni commented Apr 17, 2024

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

@hedgemanNate
Copy link
Author

hedgemanNate commented Apr 17, 2024

Neither works.

@intitni
Copy link
Owner

intitni commented Apr 17, 2024

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
Copy link
Author

hedgemanNate commented Apr 17, 2024

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
Copy link
Author

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
Copy link
Owner

intitni commented Apr 17, 2024

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

@hedgemanNate
Copy link
Author

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.

@intitni intitni changed the title [Bug]: [Bug]: Can't accept suggestions Apr 17, 2024
@nrbrook
Copy link

nrbrook commented Apr 18, 2024

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
Copy link
Owner

intitni commented Apr 18, 2024

@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
Copy link

nrbrook commented Apr 18, 2024

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
Copy link

nrbrook commented Apr 18, 2024

Nevermind, it works after a reboot

@intitni
Copy link
Owner

intitni commented Apr 18, 2024

@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
Copy link

nrbrook commented Apr 18, 2024

Will do if it happens again

@intitni
Copy link
Owner

intitni commented Apr 18, 2024

@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
Copy link

nrbrook commented Apr 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants