Merge remote-tracking branch 'origin/GP-6629-dragonmacher-decompiler-snapshot-cache-patch' into patch

This commit is contained in:
Ryan Kurtz
2026-04-13 19:12:21 -04:00
2 changed files with 13 additions and 3 deletions
@@ -207,6 +207,14 @@ public class DecompilerController {
decompilerMgr.resetDecompiler();
}
/**
* Adds the given data to the cache. Meant for internal use only.
* @param data the data
*/
public void addToCache(DecompileData data) {
updateCache(data);
}
//==================================================================================================
// Methods call by the DecompilerManager
//==================================================================================================
@@ -725,11 +725,13 @@ public class DecompilerProvider extends NavigatableComponentProviderAdapter
ViewerPosition myViewPosition = controller.getDecompilerPanel().getViewerPosition();
newProvider.doSetProgram(program);
// Any change in the HighlightTokens should be delivered to the new panel
DecompilerPanel myPanel = getDecompilerPanel();
newProvider.setLocation(currentLocation, myPanel.getViewerPosition());
// initialize the new provider's cache and then set the location
DecompileData myDecompileData = controller.getDecompileData();
newProvider.controller.addToCache(myDecompileData);
newProvider.setLocation(currentLocation, myViewPosition);
// transfer any state after the new decompiler is initialized
DecompilerPanel myPanel = getDecompilerPanel();
DecompilerPanel newPanel = newProvider.getDecompilerPanel();
newProvider.doWhenNotBusy(() -> {
newPanel.setViewerPosition(myViewPosition);