mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
PY-21984 Do not add multiple hyperlinks to a public API
GitOrigin-RevId: 4d66a865e27e06ff611817e78e6e84167e51bc99
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8f36818e8a
commit
f6d738b981
@@ -17,7 +17,6 @@ package com.intellij.xdebugger.frame;
|
||||
|
||||
import com.intellij.xdebugger.Obsolescent;
|
||||
import com.intellij.xdebugger.frame.presentation.XValuePresentation;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -67,18 +66,4 @@ public interface XValueNode extends Obsolescent {
|
||||
* @see #MAX_VALUE_LENGTH
|
||||
*/
|
||||
void setFullValueEvaluator(@NotNull XFullValueEvaluator fullValueEvaluator);
|
||||
|
||||
/**
|
||||
* The ability to add an unlimited number of hyperlinks to the node
|
||||
*
|
||||
* @param link its use depends on the implementation of the interface (not used by default)
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
default void addAdditionalHyperlink(@NotNull XDebuggerTreeNodeHyperlink link) { }
|
||||
|
||||
/*
|
||||
* Clear additional hyperlinks for the node
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
default void clearAdditionalHyperlinks() { }
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public abstract class XDebuggerTreeNode implements TreeNode {
|
||||
|
||||
@NotNull
|
||||
public List<@NotNull XDebuggerTreeNodeHyperlink> getAdditionalLinks() {
|
||||
return new ArrayList<>();
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -172,7 +172,6 @@ public class XValueNodeImpl extends XValueContainerNode<XValue> implements XValu
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAdditionalHyperlink(@NotNull XDebuggerTreeNodeHyperlink link) {
|
||||
invokeNodeUpdate(() -> {
|
||||
myAdditionalHyperLinks.add(link);
|
||||
@@ -180,7 +179,6 @@ public class XValueNodeImpl extends XValueContainerNode<XValue> implements XValu
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAdditionalHyperlinks() {
|
||||
invokeNodeUpdate(() -> {
|
||||
myAdditionalHyperLinks.clear();
|
||||
|
||||
@@ -18,5 +18,6 @@
|
||||
<orderEntry type="module" module-name="intellij.python.psi" />
|
||||
<orderEntry type="module" module-name="intellij.platform.concurrency" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.util.io" />
|
||||
<orderEntry type="module" module-name="intellij.platform.debugger.impl" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -11,6 +11,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.xdebugger.frame.*;
|
||||
import com.intellij.xdebugger.frame.presentation.XRegularValuePresentation;
|
||||
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl;
|
||||
import com.jetbrains.python.PydevBundle;
|
||||
import com.jetbrains.python.debugger.pydev.PyDebugCallback;
|
||||
import com.jetbrains.python.debugger.render.PyNodeRenderer;
|
||||
@@ -472,10 +473,13 @@ public class PyDebugValue extends XNamedValue {
|
||||
|
||||
private void setConfigureTypeRenderersLink(@NotNull XValueNode node) {
|
||||
String typeRendererId = getTypeRendererId();
|
||||
node.clearAdditionalHyperlinks();
|
||||
if (typeRendererId != null) {
|
||||
XDebuggerTreeNodeHyperlink link = myFrameAccessor.getUserTypeRenderersLink(typeRendererId);
|
||||
if (link != null) node.addAdditionalHyperlink(link);
|
||||
if (node instanceof XValueNodeImpl) {
|
||||
XValueNodeImpl valueNode = (XValueNodeImpl)node;
|
||||
valueNode.clearAdditionalHyperlinks();
|
||||
if (typeRendererId != null) {
|
||||
XDebuggerTreeNodeHyperlink link = myFrameAccessor.getUserTypeRenderersLink(typeRendererId);
|
||||
if (link != null) valueNode.addAdditionalHyperlink(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ import com.intellij.xdebugger.breakpoints.*;
|
||||
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
|
||||
import com.intellij.xdebugger.frame.*;
|
||||
import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl;
|
||||
import com.intellij.xdebugger.stepping.XSmartStepIntoHandler;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.PythonFileType;
|
||||
@@ -889,8 +890,11 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
|
||||
if (e.getMessage().startsWith("Timeout")) {
|
||||
value.updateNodeValueAfterLoading(node, " ", "", PyBundle.message("debugger.variables.view.loading.timed.out"));
|
||||
ConfigureTypeRenderersHyperLink configureLink = new ConfigureTypeRenderersHyperLink(null, getProject(), value);
|
||||
node.clearAdditionalHyperlinks();
|
||||
node.addAdditionalHyperlink(configureLink);
|
||||
if (node instanceof XValueNodeImpl) {
|
||||
XValueNodeImpl valueNode = (XValueNodeImpl)node;
|
||||
valueNode.clearAdditionalHyperlinks();
|
||||
valueNode.addAdditionalHyperlink(configureLink);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG.error(e);
|
||||
|
||||
Reference in New Issue
Block a user