They change the variable myNumber. Okay so in the ast I know myNumberis referenced by callexpression line([0, myNumber], %) that has segment id 23123123 and call expression line([myNumber, 0], %) that has segment id akjsdnaksdn. (Yes I know the ids are uuids just bear w me.)
So I know what they changed and I know those segments. So I would just move both those to the new values with a websocket call each to change them. Of course now that I say this I have no idea what cmd that would be. But I assume we have the functionality for this if we can move lines in the ui.
they delete line #2 of the sketch |> line([0, myNumber], %) now this one is a bit tricky just because lines are relative, so I would call a websocket call to delete the extrudePath, a websocket call to delete the closePath, a websocket call to delete all the segments after #2 and then I'd start re-executing the path from there. Obviously in this scenario we could be smart about it and just fucking clobber the sketch and start over (to which I would say I also need the clobber bool exposed to me on the rust end in the command) since its less calls, but wanted to just show how I'm thinking of reversing these things when things happen.
so a few examples of how this should work:
moving lines
The user has the following code:
They change the variable
myNumber
. Okay so in the ast I knowmyNumber
is referenced by callexpressionline([0, myNumber], %)
that has segment id23123123
and call expressionline([myNumber, 0], %)
that has segment idakjsdnaksdn
. (Yes I know the ids are uuids just bear w me.)So I know what they changed and I know those segments. So I would just move both those to the new values with a websocket call each to change them. Of course now that I say this I have no idea what cmd that would be. But I assume we have the functionality for this if we can move lines in the ui.
deleting lines
The user has the following code:
they delete line #2 of the sketch
|> line([0, myNumber], %)
now this one is a bit tricky just because lines are relative, so I would call a websocket call to delete theextrudePath
, a websocket call to delete theclosePath
, a websocket call to delete all the segments after #2 and then I'd start re-executing the path from there. Obviously in this scenario we could be smart about it and just fucking clobber the sketch and start over (to which I would say I also need theclobber bool
exposed to me on the rust end in the command) since its less calls, but wanted to just show how I'm thinking of reversing these things when things happen.