mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-159444 Improve value tooltip presentation in debugger - show shortcut only if shown from keyboard
This commit is contained in:
+1
-1
@@ -82,7 +82,7 @@ public class XQuickEvaluateHandler extends QuickEvaluateHandler {
|
||||
resultPromise.setResult(null);
|
||||
return;
|
||||
}
|
||||
resultPromise.setResult(new XValueHint(project, editor, point, type, expressionInfo, evaluator, session));
|
||||
resultPromise.setResult(new XValueHint(project, editor, point, type, expressionInfo, evaluator, session, false));
|
||||
});
|
||||
return resultPromise;
|
||||
});
|
||||
|
||||
+6
-3
@@ -78,6 +78,7 @@ public class XValueHint extends AbstractValueHint {
|
||||
|
||||
private final XDebuggerEvaluator myEvaluator;
|
||||
private final XDebugSession myDebugSession;
|
||||
private final boolean myFromKeyboard;
|
||||
private final String myExpression;
|
||||
private final String myValueName;
|
||||
private final @Nullable XSourcePosition myExpressionPosition;
|
||||
@@ -88,11 +89,12 @@ public class XValueHint extends AbstractValueHint {
|
||||
|
||||
public XValueHint(@NotNull Project project, @NotNull Editor editor, @NotNull Point point, @NotNull ValueHintType type,
|
||||
@NotNull ExpressionInfo expressionInfo, @NotNull XDebuggerEvaluator evaluator,
|
||||
@NotNull XDebugSession session) {
|
||||
@NotNull XDebugSession session, boolean fromKeyboard) {
|
||||
super(project, editor, point, type, expressionInfo.getTextRange());
|
||||
|
||||
myEvaluator = evaluator;
|
||||
myDebugSession = session;
|
||||
myFromKeyboard = fromKeyboard;
|
||||
myExpression = XDebuggerEvaluateActionHandler.getExpressionText(expressionInfo, editor.getDocument());
|
||||
myValueName = XDebuggerEvaluateActionHandler.getDisplayText(expressionInfo, editor.getDocument());
|
||||
myExpressionInfo = expressionInfo;
|
||||
@@ -126,7 +128,8 @@ public class XValueHint extends AbstractValueHint {
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
hideHint();
|
||||
final Point point = new Point(myPoint.x, myPoint.y + getEditor().getLineHeight());
|
||||
new XValueHint(getProject(), getEditor(), point, ValueHintType.MOUSE_CLICK_HINT, myExpressionInfo, myEvaluator, myDebugSession).invokeHint();
|
||||
new XValueHint(getProject(), getEditor(), point, ValueHintType.MOUSE_CLICK_HINT, myExpressionInfo, myEvaluator, myDebugSession,
|
||||
true).invokeHint();
|
||||
}
|
||||
}.registerCustomShortcutSet(shortcut, getEditor().getContentComponent(), myDisposable);
|
||||
}
|
||||
@@ -208,7 +211,7 @@ public class XValueHint extends AbstractValueHint {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (getType() == ValueHintType.MOUSE_OVER_HINT) {
|
||||
if (getType() == ValueHintType.MOUSE_OVER_HINT && myFromKeyboard) {
|
||||
text.insert(0, "(" + KeymapUtil.getFirstKeyboardShortcutText("ShowErrorDescription") + ") ",
|
||||
SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -193,7 +193,7 @@ public abstract class XVariablesViewBase extends XDebugView {
|
||||
int offset = range.getStartOffset();
|
||||
LogicalPosition pos = myEditor.offsetToLogicalPosition(offset);
|
||||
Point point = myEditor.logicalPositionToXY(pos);
|
||||
new XValueHint(myProject, myEditor, point, ValueHintType.MOUSE_OVER_HINT, info, evaluator, session).invokeHint();
|
||||
new XValueHint(myProject, myEditor, point, ValueHintType.MOUSE_OVER_HINT, info, evaluator, session, true).invokeHint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user