You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, it’s not easily possible in the current design where we assume all nodes for the Fix-It to already be present in the syntax tree so that we just need to flip the token presence.
I would say that it’s good enough for now but adding support for these kinds of Fix-Its might be useful in general. What we need for that is, IMO, a new Fixit.Change that takes a syntax node, a key path within that node and a replacement node, i.e. something like case replace<NodeType, ChildType>(node: NodeType, path: KeyPath<NodeType, ChildType>, child: ChildType) – and yes I see the irony of declaring a generic enum case here, you would need to come up with some design that actually compiles, I haven’t thought about it too much yet.
I think this kind of Fix-It change might also be useful for macro authors. IIRC it came up once or twice but was never super important.
The text was updated successfully, but these errors were encountered:
Description
From #2286 (comment)
The text was updated successfully, but these errors were encountered: