CopilotForXcode icon indicating copy to clipboard operation
CopilotForXcode copied to clipboard

Swift Code Completion does not include a closing brace

Open arthrex-rfazio opened this issue 7 months ago • 4 comments

Describe the bug If you let copilot generate a function, as it generates suggestions, when it is done, it never inserts the closing brace '}' so the end result is always a compilation error.

Versions

  • Copilot for Xcode: 0.34
  • Xcode: 16.3
  • macOS: 15.4.1

Steps to reproduce

  1. create a new project or open existing one
  2. type func and let copilot start generating code. It will never include the closing } causing the compiler to complain.

arthrex-rfazio avatar May 05 '25 20:05 arthrex-rfazio

I cannot reproduce it. When I'm typing, and use + Tab to accept the full suggestion, it includes the closing brace.

https://github.com/user-attachments/assets/e03ba111-3083-4c27-9956-946bf2c2423c

testforstephen avatar May 06 '25 07:05 testforstephen

Hi @testforstephen

yes, it only works if you hold Option key and let it generate the entire suggestion. However, my bug report was not for that. It was for a case where you keep hitting the tab key to let it generate one line at the time. Once it is done making suggestions, it will never insert the closing brace.

try it. If you can't repro, I will send a video.

Also, if you disable the "Accept suggestions with Tab" it will still make suggestions but when you hit tab, the suggestions just float on the screen. It looks really bad. I hope you guys are planning to add a little bit more options for tab completion, especially partial tab completion.

Thanks

arthrex-rfazio avatar May 06 '25 15:05 arthrex-rfazio