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]: Clicking "Accept" doesn't apply the code #311

Closed
2 tasks done
unniverzal opened this issue Jul 23, 2023 · 10 comments
Closed
2 tasks done

[Bug]: Clicking "Accept" doesn't apply the code #311

unniverzal opened this issue Jul 23, 2023 · 10 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@unniverzal
Copy link

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?

When clicking "Accept" nothing happens.
Restarting the Xcode or Mac doesn't resolve the issue.

How to reproduce the bug.

It just happens!

Relevant log output

None

macOS version

13.3.1

Xcode version

Version 14.3.1 (14E300c)

Copilot for Xcode version

0.20.1

Node version

v18.16.1

@unniverzal unniverzal added the bug Something isn't working label Jul 23, 2023
@intitni
Copy link
Owner

intitni commented Jul 23, 2023

  1. Make sure you have setup the Xcode source editor extension, as described in README.md.
  2. Make sure the Copilot menu is available under Xcode menu - Editor. If it's not there, restart Xcode.
  3. If it's not fixed, you can try turning on Always accept suggestions with Accessibility API in advanced settings if you are sure that the app is correctly setup.

-- Update --

If the accept button/keybinding/tab doesn't work, it's very likely the Copilot menu in Xcode - Menu Bar - Editor is greyed out. It's an Xcode bug that usually happens right after you update the extension. So please remember to restart Xcode after updating the extension.

Another possible cause is you have multiple versions of Copilot for Xcode.app on your Mac, and Xcode is confused by them.

I am closing this issue. Please open a new one if needed.

@unniverzal unniverzal changed the title [Bug]: [Bug]: Clicking "Accept" doesn't apply the code Jul 23, 2023
@intitni intitni added help wanted Extra attention is needed and removed bug Something isn't working labels Jul 23, 2023
@mavzerbay
Copy link

  1. Make sure you have setup the Xcode source editor extension, as described in README.md.
  2. Make sure the Copilot menu is available under Xcode menu - Editor. If it's not there, restart Xcode.
  3. If it's not fixed, you can try turning on Always accept suggestions with Accessibility API in advanced settings if you are sure that the app is correctly setup.

I'm having the same problem and I did all the things you said above, but whatever happened, it happened after the last update of copilot, I was not having such a problem before.

@intitni
Copy link
Owner

intitni commented Aug 1, 2023

@mavzerbay It's weird that the 3rd step isn't working for you. Since the whole extension works more like a hack, I can't guarantee that what works for me works for others. I can't fix it alone.

I would suggest:

  1. Make sure there is only one version of Copilot for Xcode.app exists on your Mac.
  2. Make sure that you have opened the app once and restarted Xcode after each update.
  3. Leave more information, for example, is the Copilot menu available? Can you accept suggestion from the menu? Are you using a prebuilt version of the app or are your building the app yourself?
  4. Install the previous versions and report the last version that works for you.
  5. Build and run the ExtensionService target, add a break point at PseudoCommandHandler.acceptSuggestion and click the accept button.

@chrishendersonc4
Copy link

I had this problem until I deleted the "Copilot for Xcode.app" from my Downloads folder and restarted Xcode. I had previously copied it to /Applications, but I should have moved it instead. The giveaway was seeing two octopus tentacle icons (the icon for this app, Copilot for Xcode) in my menu bar.

@ben-p-commits
Copy link

For me, quitting "Copilot for Xcode.app" fixed this issue.

@Dark-Existed
Copy link

Dark-Existed commented Nov 14, 2023

I hava the same problem, this happen to me when I open mulit Xcode project. When I turning on Always accept suggestions with Accessibility API in advanced settings, click accept will works, but the other projacts will appear to foregroud. Even the keybinding is setted, the keybinding is not working. So may the problem about solving the window focus.

Xcode version 15.0.1

@intitni
Copy link
Owner

intitni commented Nov 14, 2023

@Dark-Existed, if the keybinding is not working either, the Copilot menu in Xcode is probably grayed out. It's an issue with Xcode and can only be cured by restarting Xcode. It usually happens after you have updated Copilot for Xcode which may confuse Xcode.

Always accept suggestions with Accessibility API is a fallback solution that inserts the suggestion to the editor with Accessibility API, I guess it has a side effect that brings everything of the app to the foreground. I am considering replacing it with a pasteboard-based solution, no ETA yet.

@Dark-Existed
Copy link

@intitni thx, after restarting Xcode, it works for me.

@intitni intitni closed this as completed Dec 2, 2023
@mehmetbaykar
Copy link

@intitni I did all you said but still the shortcut is not working only works when you implicitly press the accept button. Do you have any suggestions?
Xcode :15.2
Macos:14.3
XcodeCopilot(latest version)

@intitni
Copy link
Owner

intitni commented Feb 16, 2024

@mehmetbaykar Please try #438. Post a screenshot of the Copilot menu to #438 if the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants