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

Introduce FixIt.Change API that replaces the child of a syntax node #2205

Open
ahoppen opened this issue Sep 16, 2023 · 2 comments
Open

Introduce FixIt.Change API that replaces the child of a syntax node #2205

ahoppen opened this issue Sep 16, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ahoppen
Copy link
Collaborator

ahoppen commented Sep 16, 2023

Currently, Fix-Its are only able to replace syntax nodes but that makes it impossible to replace a nil node by a proper syntax node.

We should offer a FixIt.Change that replaces the child of a syntax node, with a signature that’s something like this (written in GitHub, not sure if it compiles, but it gets the idea across).

FixIt.Change.replaceChild<Parent, Child>(_: KeyPath<Parent, Child>, of parent: Parent, with: Child)

FixItApplier will need to be updated to also handle this new change kind

rdar://115562892

@ahoppen ahoppen added the enhancement New feature or request label Sep 16, 2023
@mininny
Copy link
Contributor

mininny commented Oct 6, 2023

I'd like to have a go at this if it's okay!

@kimdv
Copy link
Collaborator

kimdv commented Oct 6, 2023

@mininny it now yours :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants