Skip to content

Swift Code Completion does not include a closing brace #265

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

Open
arthrex-rfazio opened this issue May 5, 2025 · 4 comments
Open

Swift Code Completion does not include a closing brace #265

arthrex-rfazio opened this issue May 5, 2025 · 4 comments

Comments

@arthrex-rfazio
Copy link

arthrex-rfazio commented May 5, 2025

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.
@testforstephen
Copy link

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

Screen.Recording.2025-05-06.at.15.01.36.mov

@arthrex-rfazio
Copy link
Author

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

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

2 participants