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

Clicking tab only does the actual tab - Tab completion not working #25

Open
iballan opened this issue Nov 6, 2024 · 28 comments
Open

Clicking tab only does the actual tab - Tab completion not working #25

iballan opened this issue Nov 6, 2024 · 28 comments

Comments

@iballan
Copy link

iballan commented Nov 6, 2024

Describe the bug

Versions

  • Copilot for Xcode: 0.28.0
  • Xcode: Version 16.1 (16B40)
  • macOS: 15.1 (24B83)

Steps to reproduce

  1. I am able to reproduce it always, rarely tab to accept works for me

Screenshots
The result:

copilot_example.mp4

I made sure all permissions are granted

Screenshot 2024-11-05 at 9 29 39 PM Screenshot 2024-11-05 at 9 29 09 PM Screenshot 2024-11-05 at 9 28 48 PM Screenshot 2024-11-05 at 9 28 43 PM

I still don't see the Github Copilot is not activated on the Editor menu:

Screenshot 2024-11-05 at 9 36 25 PM

Logs

Additional context
I tried to disable/enable all services, restart xcode, uninstall github copilot and re install it
Nothing worked for me

@devm33
Copy link
Collaborator

devm33 commented Nov 6, 2024

Hi @iballan, thanks for trying out Copilot for Xcode, sorry for the difficulty here.

To troubleshoot further, could you enable verbose logging and send the log file ~/Library/Logs/GitHubCopilot/github-copilot-for-xcode.log

@iballan
Copy link
Author

iballan commented Nov 6, 2024

Thank you for your quick reply!
I'm not able to share the log for the project I posted info about above, yet I got the log file for different project with the same issue.
This project is pretty much smaller, and Github Copilot worked one or two times in the beginning, then the same issue.
The issue i faced in this project is:
I got Github Copilot suggestion, clicked tab, the suggestion was applied.
I get the Github Copilot suggestion, clicked tab, the applied changes is coming from Xcode autocompletion and different than what copilot suggested
Then the tab started acting like the video I posted above. (Only applying actual tab ignoring the suggestion)
And sometimes it applied xcode autocompletion suggestion.
github-copilot-for-xcode.log

@devm33
Copy link
Collaborator

devm33 commented Nov 6, 2024

@iballan thanks for sharing the logs what I'm seeing there lines up with your note about Xcode extension:

I still don't see the Github Copilot is not activated on the Editor menu:

Screenshot 2024-11-05 at 9 36 25 PM

Without the extension active in Xcode, it will not work well. If you could figure out what on your system is blocking the extension from being active in Xcode that should fix or at least improve the situation.

@pvieito
Copy link

pvieito commented Nov 6, 2024

Yep, same issue here. After upgrading to 0.28 the tab completion stopped working.

@devm33
Copy link
Collaborator

devm33 commented Nov 6, 2024

@pvieito is the extension active (under Xcode > Editor > GitHub Copilot) for you?
After updating, you will need to restart Xcode to reactivate it.

@pvieito
Copy link

pvieito commented Nov 6, 2024

@devm33 Yes, I restarted Xcode and the Copilot service app & extension and the extension is enabled and appears in the Editor menu. But using tab does not accept the Copilot suggestion (it falls back to accepting Xcode completions or just writing a tab in the source code).

@devm33
Copy link
Collaborator

devm33 commented Nov 6, 2024

@pvieito can you share your log file ~/Library/Logs/GitHubCopilot/github-copilot-for-xcode.log?

@pvieito
Copy link

pvieito commented Nov 6, 2024

@devm33
Copy link
Collaborator

devm33 commented Nov 6, 2024

Thanks @pvieito! It looks like it might be failing to register your tab key event entirely.

To rule things out, I'm curious if setting a key binding to the GitHub Copilot > Accept Suggestion action works or not?

Image

@iballan
Copy link
Author

iballan commented Nov 6, 2024

@devm33 registering the key binding looks like worked for me!

Screenshot 2024-11-06 at 4 22 40 PM

Now every time I click that shortcut it worked

@pvieito
Copy link

pvieito commented Nov 6, 2024

@devm33 Setting a custom key binding with modifier keys like @iballan did works. But setting it to only the "tab" key, does not work.

@devm33
Copy link
Collaborator

devm33 commented Nov 9, 2024

@pvieito Yep tab would be difficult to set as an keybinding in Xcode since Xcode would not let you use tab for anything else in that case.

I'm curious if there's anything unique about your keyboard input that make might the tab key event different?

@linusix
Copy link

linusix commented Nov 10, 2024

Before upgrading to version 0.28, it worked as intended as a tab. After upgrading, tab did not work for me as well, so I bound the alt + command + tab keys and it worked, but the problem is that the alt key is pressed, so full suggestion is applied unconditionally. Is there a key that allows basic suggestion and full suggestion? Additionally, regardless of key binding, the tip that appears in the editor tells you to press tab.

@Zayox
Copy link

Zayox commented Nov 10, 2024

Same problem here!
At first, everything was fine for about a week, but now the Tab key just does an actual tab.
Maybe everything fell apart when I connected my Bluetooth Magic Keyboard. I tried disconnecting it, but the issue persists.
The only workaround, as mentioned above, is to manually set a custom key binding, but I miss using the simple Tab key to accept suggestions.

@devm33
Copy link
Collaborator

devm33 commented Nov 10, 2024

@linusix @Zayox sorry the tab functionality isn't working for you. Would either of you be able to share the log (~/Library/Logs/GitHubCopilot/github-copilot-for-xcode.log) when you try to press tab to accept a suggestion? (It should have some debug information on what went wrong).

Also, for the purpose of narrowing down the issue, if you downgrade to 0.27.* does the tab accept work again?

so I bound the alt + command + tab keys and it worked, but the problem is that the alt key is pressed, so full suggestion is applied unconditionally

@linusix acknowledging this is an issue that needs to be fixed. Semi-related to #10

@Zayox
Copy link

Zayox commented Nov 10, 2024

I've update from 0.27 to 0.28 just because I faced this problem but as you know it didn't fix it.

Here are some logs:
github-copilot-for-xcode.log

@devm33
Copy link
Collaborator

devm33 commented Nov 11, 2024

Thanks for providing logs @Zayox. Here's a build that will provide more (a lot more, will be a noisy log) debug info for the tab accept feature: https://github.com/github/CopilotForXcode/releases/download/0.28.0/GitHubCopilotForXcode_debugTab.dmg

Could you try to use tab to accept with this build and then share the logs?

Note: after installing from the dmg, you will need to run GitHub Copilot manually and restart Xcode.

@linusix
Copy link

linusix commented Nov 11, 2024

@devm33 Log (using GitHubCopilotForXcode_debugTab.dmg)
All key bindings are all empty.

github-copilot-for-xcode.log

2024-11-11.2.45.17.2.mov
screenshot

@devm33
Copy link
Collaborator

devm33 commented Nov 12, 2024

@linusix Thank you for sharing logs and bearing with us here. It seems that Copilot for Xcode is not able to register any key presses on your system. Is it possible that there is something unique about your keyboard input either in hardware or software?

As another attempt to try to get debugging information, could you try running this dmg and sharing the logs: https://github.com/github/CopilotForXcode/releases/download/0.28.0/GitHubCopilotForXcode_debugTabMore.dmg

@Zayox
Copy link

Zayox commented Nov 13, 2024

Hey sorry for the delayed response.
Here are the logs from GitHubCopilotForXcode_debugTab.dmg.
Installing the new version temporarily resolved the issue, but the problem has since returned.

github-copilot-for-xcode.log

@devm33
Copy link
Collaborator

devm33 commented Nov 14, 2024

Thanks @Zayox! Do you know if there's anything else on your system correlated with when it was working or not? Looking at the logs it appears to just stop recording key events at certain startups.

If you don't mind could you try running this dmg to gather more debug logs: https://github.com/github/CopilotForXcode/releases/download/0.28.0/GitHubCopilotForXcode_debugTabMore.dmg

@Zayox
Copy link

Zayox commented Nov 14, 2024

Looks like v.0.29.0 didn't fix the problem :/

here are the logs:
github-copilot-for-xcode.log

@Zayox
Copy link

Zayox commented Nov 14, 2024

If you wanna contact me on discord to solve the issue, here is my discord:
zayox0046

I'm currently available

@devm33
Copy link
Collaborator

devm33 commented Nov 14, 2024

Hi @Zayox, sorry the 0.29.0 didn't have any fixes for this issue in it.

Let me know if you're able to gather logs with this version: https://github.com/github/CopilotForXcode/releases/download/0.28.0/GitHubCopilotForXcode_debugTabMore.dmg

@wombat2k
Copy link

@devm33 I just experienced the same issue. In my case, I do use Karabiner-Elements, but it used to work fine with it from the beginning until I noticed today. Same symptoms as reported here. Extension is enabled and has been working fine for a while. The only thing that I can think of might have influenced it is updating to MacOS 15.1.1 yesterday.

Oddly, as I typed this, I tried restarting Xcode again as well as and now it works as before. I'm on 0.29. Maybe a full machine restart might help other people?

@Zayox
Copy link

Zayox commented Nov 21, 2024

FYI: For some reasons, I haven't faced this problem anymore since the start of the week. 🤷‍♂️

@bome
Copy link

bome commented Nov 21, 2024

The extension works fine for me if I'm working directly at my Mac. But when using it remotely via NoMachine, TAB does not work. Defining Option+TAB in Xcode key bindings fixes it, but only when pressing Option+TAB.

@wombat2k
Copy link

FWIW, I just hit the same issue again after upgrading Xcode (after having upgraded MacOS 15.2). A reboot of the machine fixed the issue. I'm sure there is a more granular way of fixing this, but 🤷.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants