How do I create a new root by adding and removing nodes retrieved from the old root?
I am creating a Code Fix that changes this: if(obj is MyClass) { var castedObj = obj as MyClass; } into this: var castedObj = obj as MyClass; if(castedObj != null) { } This means I have to do 3 things: Change the condition in the if statement. Move the casting right above the if statement. Remove the statement in the body. So far, all my attempts have stranded me at getting at most 2 of these things to work. I believe this problem occurs because you basically have 2 syntax nodes on the same level. As such, making a change to one of them invalidates the location of the other one. Or something