Get virtual files for changed files till specified label
I've implemented a way to revert changes by first creating a local history label via:
val label = LocalHistory.getInstance().putSystemLabel(project, "voqal.edit.$memoryId")
val action = LocalHistory.getInstance().startAction("voqal.edit.action.$memoryId")
I can then make all the changes I want and revert to before those changes via:
action.finish()
label.revert(project, editor.virtualFile)
This works perfectly for changes in the virtual file in the editor, but not for any of the other files which have changed due to those edits. For example, if I rename the class this will modify other files. My understanding is that I need to get a list of the virtual files for everything that has changed since the label/action created above and iteratively call label.revert() on all of them. How do I get a list of the modified virtual files up till a specified label/action?
Please sign in to leave a comment.
Hi,
Unfortunately, there is no open API for this use case.
If this is crucial for your plugin, I suggest creating an API request on YouTrack (https://youtrack.jetbrains.com/issues/IJPL, Subsystem: Version Control. Local History), and our team will consider implementing it.