From 982416687e8483927a52b1b9f4aa55a41ffc6a39 Mon Sep 17 00:00:00 2001 From: Alexander Kuznetsov Date: Mon, 23 Jun 2025 15:05:21 +0200 Subject: [PATCH] IDEA-374719 [debugger] Rearrange call chains in XStackFrame's default implementations Both new methods should delegate to the old customizePresentation by default. Otherwise, "Copy Stack" functionality regresses in every implementation that provides custom customizePresentation but not customizeTextPresentation. (cherry picked from commit 1a9ebc65b694d445ca67c650da0f0a14f8ce94b7) IJ-CR-166739 GitOrigin-RevId: 8245fabe744417ac192373a3ebc74073d336339d --- .../intellij/xdebugger/frame/XStackFrame.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XStackFrame.java b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XStackFrame.java index d4de694dc350..011fb714171b 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XStackFrame.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XStackFrame.java @@ -69,7 +69,15 @@ public abstract class XStackFrame extends XValueContainer { * Otherwise, override {@link #customizePresentation()} to provide (asynchronous) presentation update. */ public void customizePresentation(@NotNull ColoredTextContainer component) { - customizeTextPresentation(component); + XSourcePosition position = getSourcePosition(); + if (position != null) { + component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); + component.append(":" + (position.getLine() + 1), SimpleTextAttributes.REGULAR_ATTRIBUTES); + component.setIcon(AllIcons.Debugger.Frame); + } + else { + component.append(XDebuggerBundle.message("invalid.frame"), SimpleTextAttributes.ERROR_ATTRIBUTES); + } } /** @@ -96,14 +104,6 @@ public abstract class XStackFrame extends XValueContainer { * not as a visible UI component. "Copy Stack" is one of the prominent examples. */ public void customizeTextPresentation(@NotNull ColoredTextContainer component) { - XSourcePosition position = getSourcePosition(); - if (position != null) { - component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); - component.append(":" + (position.getLine() + 1), SimpleTextAttributes.REGULAR_ATTRIBUTES); - component.setIcon(AllIcons.Debugger.Frame); - } - else { - component.append(XDebuggerBundle.message("invalid.frame"), SimpleTextAttributes.ERROR_ATTRIBUTES); - } + customizePresentation(component); } }