This project is read-only.

Splitting trees (RemoveRange, NodesAfter, NodesBefore)

Topics: APIs
May 29, 2014 at 8:04 PM
Edited May 29, 2014 at 9:53 PM
I need to split a SyntaxNode at its child or token into two. Now the API does not look really helpful with this scenario, there doesn't seem to be any SyntaxNode.NodesAfter/Before or ChildNodesAndTokensAfter/Before or ReplaceNodesTo/From etc. and in case of SyntaxTokenList there even isn't RemoveRange. Furthermore it seems a bit tricky to replace multiple child nodes with one.

So the only way I see to do this is to loop through the children/token collection and mutate the node at every step in which case I wonder about performance a bit.

Have I overlooked something?