Skip to content

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

Closed
@ahoppen

Description

@ahoppen

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions