XPC Service hits 100% CPU and stops responding
from maintainer: If the app is freezing for you, please check the 0.8.5 release
Hi,
I'm still trying to get this to work. Suggestions start appearing, but immediately the XPC service hits 100% CPU and completely stops responding.
This happens every single time, I have no idea why. Any ideas?

Which version are you using? It's a known issue in 0.8.1 but should have been fixed in 0.8.2
I guess it's 0.8.3 base on the screenshot.
Does it crash after stop responding? If so you can get a crash report from the Console.app.
If not, please let me know:
- Does it happen in comment mode?
- Where is the file located?
- How big is the project you are opening in Xcode? Will it freeze if you run the command on a swift playground at ~/Desktop?
- Would you mind sharing a copy of the file you were editing?
Or, maybe, can you run time profiler on the extension service?
Does it happen in comment mode?
No, only floating.
Where is the file located?
Locally
How big is the project you are opening in Xcode? Will it freeze if you run the command on a swift playground at ~/Desktop?
Yes, it still freezes.
Would you mind sharing a copy of the file you were editing?
It happens with every file, unfortunately.
Does it crash after stop responding? If so you can get a crash report from the Console.app.
Sadly no, it doesn't crash, it just hangs.
I can't reproduce the bug, so I need your help to locate it. I have prepared a modified version of the app, wherein I have disabled some features that may cause the problem. I have also added a few toggles in the host app, which you can use to turn these features back on. Please turn these toggles on one by one, and then run the ‘get suggestions’ command after making each change. Once you identify the toggle that causes the app to freeze, please let me know. Thanks. Copilot for Xcode.app.zip
It seems like, real-time suggestion with floating widget will cause the app freeze.
xcode version: 14.2 copilot for Xcode version: 0.8.2
![]()
It seems like, real-time suggestion with floating widget will cause the app freeze.
xcode version: 14.2
copilot for Xcode version: 0.8.2
@cr2s367067 I can't reproduce it, would you mind installing the modified version mentioned above to help me locate the bug?
It would be better if you can do a time profiling on the app.

The pictures above are a combination of the toggles, it looks like the suggestion panel and syntax highlighting will cause the freeze. I would love to keep testing it when I get free.
@cr2s367067 Thank you. Do you mean all these combinations can cause freeze? If the syntax highlighting and suggestion panel looks suspicious to you, do you my trying the following?
A:
- Turn every toggle on, but try to generate suggestions for a file that is not in Swift, for example a markdown file. Swift has its own syntax highlighter.
B:
- Only turn off "Enable SuggestionPanelView code block". And would you mind telling me your macOS version?
Turn every toggle on, but try to generate suggestions for a file that is not in Swift, for example a markdown file. Swift has its own syntax highlighter.
Markdown also hangs
Only turn off "Enable SuggestionPanelView code block". And would you mind telling me your macOS version?
It works if you disable the SuggestionPanelView code block. But it doesn't work if you only disable syntax highlighting.
So the problem is with the code block, but not the syntax highlighting.
MacOS 13.1 (22C65)
@timwredwards Thank you! I think we are pretty close to the real cause, I would guess it's some kind of SwiftUI bug. Here is a new version that changes the code block from LazyVGrid to VStack, and adds a new toggle to enable the code part in the code block view. Would you mind giving it a try? If it's still not working, I think I will have to make it a web view. Copilot for Xcode.app.zip

Do you mean all these combinations can cause freeze? Yes, those combination will cause freeze.
-
Markdown file with toggle on It is still freeze in markdown file with the every toggle on, and I try turn off "Enable SuggestionPanelView code block", it won't freeze, So I guess the panel will cause freeze the view.
-
Only turn off "Enable SuggestionPanelView code block It won't freeze the view.
macOS version: Ventrua 13.2.1
@cr2s367067 Oops I thought it was some Apple bug fixed in 13.2.1, but looks like it's not because I am also at 13.2.1. Please also give the following version a try! Thank you.
@timwredwards Thank you! I think we are pretty close to the real cause, I would guess it's some kind of SwiftUI bug. Here is a new version that changes the code block from LazyVGrid to VStack, and adds a new toggle to enable the code part in the code block view. Would you mind giving it a try? If it's still not working, I think I will have to make it a web view. Copilot for Xcode.app.zip
@timwredwards Thank you! I think we are pretty close to the real cause, I would guess it's some kind of SwiftUI bug. Here is a new version that changes the code block from LazyVGrid to VStack, and adds a new toggle to enable the code part in the code block view. Would you mind giving it a try? If it's still not working, I think I will have to make it a web view. Copilot for Xcode.app.zip
This seems to work, with all toggles activated! I'll keep testing and get back to you if I experience another hang.
[Tears on my face]