Skip to content
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

Improve auto-pairing in code editor #18024

Open
Tracked by #18023
PalumboN opened this issue Mar 20, 2025 · 2 comments
Open
Tracked by #18023

Improve auto-pairing in code editor #18024

PalumboN opened this issue Mar 20, 2025 · 2 comments

Comments

@PalumboN
Copy link
Collaborator

PalumboN commented Mar 20, 2025

We refer to auto-pairing to the way of automatically close brackets and quotes (and other "smart characters") when you open them.

In the next gif, we can see how both parenthesis are written when I just input (, and removed when I remove it. But there are some border cases where this is not working well (for example, for removing [ ]).

Image

Current problems

  • The logic to make the pairing of the "smart characters" on smart remove is not accurate (look the methods on CompletionEngine class with smartBackspace*, for example smartNeedExtraRemovePairedIn:for:opposite:at: ): it is looking on all the text, including comments, for example, what it's not correct.

  • Now the smart remove only works if the characters are adjacent. For example, in the gif above, the [ ] are inserted with n space in the middle. So, when I remove the open [, the close one ] is not removed.

@PalumboN PalumboN changed the title Improve _auto-pairing_ in code editor Improve auto-pairing in code editor Mar 20, 2025
@AlexisCnockaert
Copy link
Collaborator

Hello @PalumboN and @Gabriel-Darbord, I fixed this issue and ready to make a PR but I saw too late that it was for a project linked to GSoC 2025, do I keep my work for me or not ? :)

@Gabriel-Darbord
Copy link
Contributor

@AlexisCnockaert This issue is related to a GSoC project, but it is not exclusive to GSoC. If you have a fix, please do a PR :)

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

3 participants