4 ms·
I have thought about and wanted exactly this when refactoring on a branch. I later want to perform the same refactoring upon rebasing to a newer point on master
by karmakaze 7y ago
I have thought about and wanted exactly this when refactoring on a branch. I later want to perform the same refactoring upon rebasing to a newer point on master. There have even been times where I've done this manually by either making mental notes, or explicit bullet points of operations as I perform them. It works great but is tedious and is easy to imagine that the IDE could do this, or the IDE provide an API that can run a script of transformations. JetBrains and their set of tools is the closest place where I can imagine this could be achieved. Perhaps in combination with the language being edited represented in MPS[0] form (of which I have no knowledge).
MPS does present a different aspect in the examples shown. It is still text editing, but not the linear word by word syntax we're used to. We can make up 2D, tree, or any other structure that can conceptually and compactly represent our thinking.
One more point I have on this is that the editor itself can recognize 'edit units' that are not mere characters inserted/replaced/deleted. As edits are made, it can make higher level 'checkpoints' whenever a unit is recognized. The examples in this post are great examples: function declaration, renaming, invocation. Then the undo/redo can show text operations as low-level points as well as higher level ones identifying larger logical units. Having that, one could perhaps select a range of these and cut them to be replayed at a later point. This is similar to how I'll make small local git commits and later reorder, squash or drop commits or make them into separate PRs.
[0] https://www.jetbrains.com/mps https://www.jetbrains.com/mps