CopilotForXcode
CopilotForXcode copied to clipboard
Clicking tab only does the actual tab - Tab completion not working
Describe the bug
Versions
- Copilot for Xcode: 0.28.0
- Xcode: Version 16.1 (16B40)
- macOS: 15.1 (24B83)
Steps to reproduce
- I am able to reproduce it always, rarely tab to accept works for me
Screenshots The result:
https://github.com/user-attachments/assets/e5069379-13b7-4860-9173-4ba97975d2cb
I made sure all permissions are granted
I still don't see the Github Copilot is not activated on the Editor menu:
Logs
Additional context I tried to disable/enable all services, restart xcode, uninstall github copilot and re install it Nothing worked for me
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
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
@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:
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.
Yep, same issue here. After upgrading to 0.28 the tab completion stopped working.
@pvieito is the extension active (under Xcode > Editor > GitHub Copilot) for you? After updating, you will need to restart Xcode to reactivate it.
@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).
@pvieito can you share your log file ~/Library/Logs/GitHubCopilot/github-copilot-for-xcode.log?
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?
@devm33 registering the key binding looks like worked for me!
Now every time I click that shortcut it worked
@devm33 Setting a custom key binding with modifier keys like @iballan did works. But setting it to only the "tab" key, does not work.
@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?
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.
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.
@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 https://github.com/github/copilotforXcode/issues/10
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
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.
@devm33 Log (using GitHubCopilotForXcode_debugTab.dmg) All key bindings are all empty.
https://github.com/user-attachments/assets/b8933949-f337-4d1e-8351-b512183b79ba
@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
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.
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
If you wanna contact me on discord to solve the issue, here is my discord: zayox0046
I'm currently available
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
@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?
FYI: For some reasons, I haven't faced this problem anymore since the start of the week. 🤷♂️
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.
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 🤷.
I've just installed the extension and ran into the same issue. Setting a hotkey manually seems to work fine.
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 🤷.
Same for me after having upgraded to MacOS 15.2, simply rebooting my machine and it is working as intended again.