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(); 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 // Methods call by the DecompilerManager
//================================================================================================== //==================================================================================================
@@ -725,11 +725,13 @@ public class DecompilerProvider extends NavigatableComponentProviderAdapter
ViewerPosition myViewPosition = controller.getDecompilerPanel().getViewerPosition(); ViewerPosition myViewPosition = controller.getDecompilerPanel().getViewerPosition();
newProvider.doSetProgram(program); newProvider.doSetProgram(program);
// Any change in the HighlightTokens should be delivered to the new panel // initialize the new provider's cache and then set the location
DecompilerPanel myPanel = getDecompilerPanel(); DecompileData myDecompileData = controller.getDecompileData();
newProvider.setLocation(currentLocation, myPanel.getViewerPosition()); newProvider.controller.addToCache(myDecompileData);
newProvider.setLocation(currentLocation, myViewPosition);
// transfer any state after the new decompiler is initialized // transfer any state after the new decompiler is initialized
DecompilerPanel myPanel = getDecompilerPanel();
DecompilerPanel newPanel = newProvider.getDecompilerPanel(); DecompilerPanel newPanel = newProvider.getDecompilerPanel();
newProvider.doWhenNotBusy(() -> { newProvider.doWhenNotBusy(() -> {
newPanel.setViewerPosition(myViewPosition); newPanel.setViewerPosition(myViewPosition);