mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
[rd debugger] Migrated more split actions to XDebuggerTreeSplitActionBase
IJPL-198039 GitOrigin-RevId: dcda77c853dd057b1883dd806ebf1daf6bb1c142
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5791ab1c36
commit
1908e5c4e2
@@ -4,14 +4,14 @@ package com.intellij.debugger.actions
|
||||
import com.intellij.java.debugger.impl.shared.actions.ViewTextActionBase
|
||||
import com.intellij.java.debugger.impl.shared.engine.JavaValueDescriptor
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeActionBase
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeSplitActionBase
|
||||
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
class ViewTextAction : ViewTextActionBase() {
|
||||
@ApiStatus.Internal
|
||||
override fun getStringNode(e: AnActionEvent): XValueNodeImpl? {
|
||||
val node = XDebuggerTreeActionBase.getSelectedNodes(e.dataContext).singleOrNull() ?: return null
|
||||
val node = XDebuggerTreeSplitActionBase.getSelectedNodes(e.dataContext).singleOrNull() ?: return null
|
||||
val xValue = node.valueContainer
|
||||
val descriptor = xValue.xValueDescriptorAsync?.getNow(null) as? JavaValueDescriptor ?: return null
|
||||
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@ import com.intellij.platform.debugger.impl.shared.SplitDebuggerAction;
|
||||
import com.intellij.xdebugger.impl.DebuggerSupport;
|
||||
import com.intellij.xdebugger.impl.actions.handlers.XAddToWatchesFromEditorActionHandler;
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XAddToWatchesTreeAction;
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeActionBase;
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeSplitActionBase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
final class AddToWatchesAction extends XDebuggerActionBase implements SplitDebuggerAction {
|
||||
@@ -27,7 +27,7 @@ final class AddToWatchesAction extends XDebuggerActionBase implements SplitDebug
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent event) {
|
||||
if (XDebuggerTreeActionBase.getSelectedNode(event.getDataContext()) != null) {
|
||||
if (XDebuggerTreeSplitActionBase.getSelectedNode(event.getDataContext()) != null) {
|
||||
Holder.TREE_ACTION.update(event);
|
||||
}
|
||||
else {
|
||||
@@ -37,7 +37,7 @@ final class AddToWatchesAction extends XDebuggerActionBase implements SplitDebug
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent event) {
|
||||
if (XDebuggerTreeActionBase.getSelectedNode(event.getDataContext()) != null) {
|
||||
if (XDebuggerTreeSplitActionBase.getSelectedNode(event.getDataContext()) != null) {
|
||||
Holder.TREE_ACTION.actionPerformed(event);
|
||||
}
|
||||
else {
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ import com.intellij.xdebugger.frame.XStackFrame;
|
||||
import com.intellij.xdebugger.frame.XValue;
|
||||
import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
|
||||
import com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog;
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeActionBase;
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeSplitActionBase;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -69,7 +69,7 @@ public class XDebuggerEvaluateActionHandler extends XDebuggerActionHandler {
|
||||
Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
|
||||
PsiFile psiFile = CommonDataKeys.PSI_FILE.getData(dataContext);
|
||||
VirtualFile file = CommonDataKeys.VIRTUAL_FILE.getData(dataContext);
|
||||
XValue selectedValue = XDebuggerTreeActionBase.getSelectedValue(dataContext);
|
||||
XValue selectedValue = XDebuggerTreeSplitActionBase.getSelectedValue(dataContext);
|
||||
|
||||
getSelectedExpressionAsync(project, evaluator, editor, psiFile, selectedValue)
|
||||
.onSuccess(expression -> AppUIUtil.invokeOnEdt(() -> showDialog(session, file, editorsProvider, stackFrame, evaluator, expression)));
|
||||
|
||||
+4
-4
@@ -16,7 +16,7 @@ import com.intellij.xdebugger.impl.frame.XValueMarkers
|
||||
import com.intellij.xdebugger.impl.ui.DebuggerUIUtil
|
||||
import com.intellij.xdebugger.impl.ui.tree.ValueMarkerPresentationDialog
|
||||
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTreeState
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeActionBase
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeSplitActionBase
|
||||
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -30,7 +30,7 @@ internal class XMarkObjectActionHandler : MarkObjectActionHandler() {
|
||||
if (session == null) return
|
||||
|
||||
val markers = session.valueMarkers
|
||||
val node = XDebuggerTreeActionBase.getSelectedNode(event.dataContext)
|
||||
val node = XDebuggerTreeSplitActionBase.getSelectedNode(event.dataContext)
|
||||
if (markers == null || node == null) return
|
||||
val detachedView = DebuggerUIUtil.isInDetachedTree(event)
|
||||
val treeState = XDebuggerTreeState.saveState(node.tree)
|
||||
@@ -49,7 +49,7 @@ internal class XMarkObjectActionHandler : MarkObjectActionHandler() {
|
||||
val markers: XValueMarkers<*, *>? = getValueMarkers(event)
|
||||
if (markers == null) return false
|
||||
|
||||
val value = XDebuggerTreeActionBase.getSelectedValue(event.dataContext)
|
||||
val value = XDebuggerTreeSplitActionBase.getSelectedValue(event.dataContext)
|
||||
return value != null && markers.canMarkValue(value) && XDebugManagerProxy.getInstance().hasBackendCounterpart(value)
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ internal class XMarkObjectActionHandler : MarkObjectActionHandler() {
|
||||
val markers: XValueMarkers<*, *>? = getValueMarkers(event)
|
||||
if (markers == null) return false
|
||||
|
||||
val value = XDebuggerTreeActionBase.getSelectedValue(event.dataContext)
|
||||
val value = XDebuggerTreeSplitActionBase.getSelectedValue(event.dataContext)
|
||||
return value != null && markers.getMarkup(value) != null
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ object SplitDebuggerUIUtil {
|
||||
fun getXDebuggerTreeSelectedBackendValues(dataContext: DataContext): List<XDebuggerTreeSelectedValue> {
|
||||
if (showSplitWarnings() && getFrontendType() is FrontendType.Remote) {
|
||||
LOG.error("SplitDebuggerUIUtil#getXDebuggerTreeSelectedBackendValues should not be called from the frontend. " +
|
||||
"Please use XDebuggerTree.SELECTED_NODES#getData instead.")
|
||||
"Please use XDebuggerTreeSplitActionBase#getSelectedNode instead.")
|
||||
}
|
||||
return if (SplitDebuggerMode.isSplitDebugger()) {
|
||||
// In Split mode, find backend values by the ids passed from the frontend
|
||||
|
||||
Reference in New Issue
Block a user