intitni / CopilotForXcode

The first GitHub Copilot, Codeium and ChatGPT Xcode Source Editor Extension
https://copilotforxcode.intii.com
MIT License
7.74k stars 375 forks source link

[Help Wanted]: Could not get Nearby suggestions #587

Closed jiyoungparki closed 3 weeks ago

jiyoungparki commented 4 weeks ago

Before Reporting

Describe your issue

I followed all the settings, including extensions and accessibility settings, as outlined in the guidelines. I can see the Copilot menu in the Editor menu.

However, the problem is that the Nearby suggestions (I selected the nearby text cursor) are not appearing while I am coding in Xcode. Could someone tell me what might be wrong?

I ran the Console and found that these two errors were coming up.

Screenshot 2024-10-03 at 8 00 59 PM
intitni commented 4 weeks ago

Please post your settings here, including the general settings, service settings and feature settings.

Make sure that you have read the FAQ: https://copilotforxcode.intii.com/faq/app-faq/#suggestion https://copilotforxcode.intii.com/faq/github-copilot-faq/

Observe the logs base on the information from the FAQ.

And answer the following questions:

  1. Can see this widget?

    Screenshot 2024-10-03 at 22 14 32
  2. Does it animate when you type.

  3. What logs did you see posted under the category GitHubCopilot.

intitni commented 4 weeks ago
Screenshot 2024-10-03 at 22 22 37

Turn the last two toggles on in Console.app, too.

jiyoungparki commented 4 weeks ago

@intitni

  1. Yes I can see the widget on the xcode

    Screenshot 2024-10-04 at 2 32 34 AM
  2. It animates while I am typing

  3. The logs I got while I am using xcode are as follows (turned on the include info messages, debug messages)

    Screenshot 2024-10-04 at 2 32 50 AM
intitni commented 4 weeks ago

Please follow the FAQ https://copilotforxcode.intii.com/faq/github-copilot-faq/ to turn on verbose log and set up the filter to only show logs from category:GitHubCopilot.

jiyoungparki commented 4 weeks ago

@intitni

Screenshot 2024-10-04 at 3 27 01 AM

filtered to only show logs from category:GitHubCopilot. and I got these logs. It seems like working, but still I couldn't find any suggestion box on the Xcode yet....

intitni commented 4 weeks ago

But you are filtering out the logs from category:Service.

Please change it to category:GitHubCopilot.

Screenshot 2024-10-04 at 13 18 28 Screenshot 2024-10-04 at 13 19 14

Restart the service app if you can't see any log.

jiyoungparki commented 4 weeks ago

@intitni
Thanks for the images. I just followed your guide. I changed the category and restarted the app for several times, and found this on the console. It seems like working normally, but still could not get any suggestions in the xcode yet.

Screenshot 2024-10-04 at 7 57 01 PM
intitni commented 4 weeks ago

Either it's working or not, you should not see only one log when you type. Normally, you will see logs about sending requests to the language server.

Please post your suggestion feature settings and GitHub Copilot settings here.

jiyoungparki commented 3 weeks ago

@intitni

Screenshot 2024-10-05 at 4 48 02 AM Screenshot 2024-10-05 at 4 48 08 AM Screenshot 2024-10-05 at 4 52 49 AM
intitni commented 3 weeks ago

And your GitHub Copilot settings.

intitni commented 3 weeks ago

Besides the GitHub Copilot settings. Please confirm if you can see other logs from category:GitHubCopilot when you type in Xcode. The logs should look like:

Screenshot 2024-10-05 at 04 01 02

My guess is it may be a network issue. Please do the following checks too:

jiyoungparki commented 3 weeks ago
Screenshot 2024-10-05 at 5 18 32 AM
jiyoungparki commented 3 weeks ago

Noting came up on the console log....

Screenshot 2024-10-05 at 5 22 13 AM
intitni commented 3 weeks ago

Please run this command from terminal. It will connect Copilot for Xcode to my debug server.

defaults write ~/Library/Group\ Containers/5YKZ4Y3DAW.group.com.intii.CopilotForXcode/Library/Preferences/5YKZ4Y3DAW.group.com.intii.CopilotForXcode.plist TestUtilityBaseURL "https://copilotforxcode-testutility.intii.com"

Open a new file that is not important to you, type something to trigger real-time suggestions. I will be able to see the request and response on my end.

After the test, you can run this to disable the server.

defaults delete ~/Library/Group\ Containers/5YKZ4Y3DAW.group.com.intii.CopilotForXcode/Library/Preferences/5YKZ4Y3DAW.group.com.intii.CopilotForXcode.plist TestUtilityBaseURL
intitni commented 3 weeks ago

I didn't receive anything. I am not sure if you have performed any action but I really need to go to sleep now.

Your settings looks correct to me. You can see the widget animates, which means real-time suggestion is triggered. But it's weird that you can't see any logs.

Another check you can try is to turn on "Enable Xcode inspector debug menu" in the advanced settings. You will find the menu in the Copilot for Xcode menu app. Please check if the active document and other information are correctly listed there.

Screenshot 2024-10-05 at 05 10 58
jiyoungparki commented 3 weeks ago

@intitni Ah.... sorry, I missed your previous comment...... Currently I found the one thing that is a bit different from you is that the Copilot for Xcode icon is not showing up on the menu bar. Is this could also cause a problem?

Screenshot 2024-10-05 at 8 26 34 AM
intitni commented 3 weeks ago

How is it even possible… Is it just hidden because you have too many icon on the menu bar and the MacBook need space for the notch? Is the CopilotForXcodeExtensionService.app still running?

intitni commented 3 weeks ago

Please try this version

https://github.com/intitni/CopilotForXcode/releases/download/0.5.0/Copilot.for.Xcode.debug.20241005.1.zip

I have added a lot of logs. Please set the console filter to process:CopilotForXcodeExtensionService and category:Service. If it eventually reaches GitHub Copilot, you will see RealtimeSuggestion: GitHub Copilot send request to service, otherwise, you will see other logs as you type and stop.

jiyoungparki commented 3 weeks ago

@intitni Thanks for the new version. I followed your guidance, and it seems like working normally, cuz I got logs like the below image.

Also the I could see the icon on the menu bar right now. (the reason why I couldn't find app icon is that there were not enough space on the menu bar.)

But It's so weird, that I couldn't get any suggessions on the xcode yet.😢

Screenshot 2024-10-05 at 8 41 07 PM
intitni commented 3 weeks ago

At least we are narrowing down the issue. It looks the the request never reaches GitHub Copilot. Please try this version with more logs.

https://github.com/intitni/CopilotForXcode/releases/download/0.5.0/Copilot.for.Xcode.debug.20241005.2.zip

jiyoungparki commented 3 weeks ago

@intitni Tried the new version, and it seems like 0 suggestions were made.

Screenshot 2024-10-06 at 3 53 56 AM
intitni commented 3 weeks ago

So it early returned in the middlewares. Hopefully this is the last try:

https://github.com/intitni/CopilotForXcode/releases/download/0.5.0/Copilot.for.Xcode.debug.2024.1006.1.zip

By looking at the code, I can't find where a middleware can early return an empty list without hitting the suggestion provider except the case the feature is disabled for the language you are using.

Any chance you have disabled it for the language? You can check it in the suggestion settings > "Disabled language list".

jiyoungparki commented 3 weeks ago

@intitni Finally, it's working!!! 🎉 🎉 🎉 Thanks for helping me out for such a long time. 👍 I found out that Swift was on the list of disabled languages. I don't think I set it up like that initially. That's so weird. Anyway, Thanks for keeping on helping me! It helped a lot. 👍👍👍

Screenshot 2024-10-06 at 1 19 30 PM
intitni commented 3 weeks ago

You may have accidentally click the menu item in the context menu of the cirlce widget.