mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
formatting
This commit is contained in:
+9
-3
@@ -54,12 +54,18 @@ public class XQuickEvaluateHandler extends QuickEvaluateHandler {
|
||||
@Override
|
||||
public AbstractValueHint createValueHint(@NotNull final Project project, @NotNull final Editor editor, @NotNull final Point point, final ValueHintType type) {
|
||||
final XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
|
||||
if (session == null) return null;
|
||||
if (session == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
XStackFrame stackFrame = session.getCurrentStackFrame();
|
||||
if (stackFrame == null) return null;
|
||||
if (stackFrame == null) {
|
||||
return null;
|
||||
}
|
||||
final XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
|
||||
if (evaluator == null) return null;
|
||||
if (evaluator == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return PsiDocumentManager.getInstance(project).commitAndRunReadAction(new Computable<XValueHint>() {
|
||||
@Override
|
||||
|
||||
+1
-3
@@ -20,7 +20,6 @@ import com.intellij.codeInsight.hint.HintManagerImpl;
|
||||
import com.intellij.codeInsight.hint.HintUtil;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.LogicalPosition;
|
||||
import com.intellij.openapi.editor.event.EditorMouseEvent;
|
||||
import com.intellij.openapi.editor.markup.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -106,8 +105,7 @@ public abstract class AbstractValueHint {
|
||||
}
|
||||
|
||||
public static int calculateOffset(@NotNull Editor editor, @NotNull Point point) {
|
||||
LogicalPosition pos = editor.xyToLogicalPosition(point);
|
||||
return editor.logicalPositionToOffset(pos);
|
||||
return editor.logicalPositionToOffset(editor.xyToLogicalPosition(point));
|
||||
}
|
||||
|
||||
public void hideHint() {
|
||||
|
||||
+16
-6
@@ -57,10 +57,14 @@ public class ValueLookupManager implements EditorMouseMotionListener {
|
||||
|
||||
@Override
|
||||
public void mouseMoved(EditorMouseEvent e) {
|
||||
if (e.isConsumed()) return;
|
||||
if (e.isConsumed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Editor editor = e.getEditor();
|
||||
if (editor.getProject() != null && editor.getProject() != myProject) return;
|
||||
if (editor.getProject() != null && editor.getProject() != myProject) {
|
||||
return;
|
||||
}
|
||||
|
||||
Point point = e.getMouseEvent().getPoint();
|
||||
if (myRequest != null && !myRequest.isKeepHint(editor, point)) {
|
||||
@@ -92,7 +96,7 @@ public class ValueLookupManager implements EditorMouseMotionListener {
|
||||
}
|
||||
|
||||
public void hideHint() {
|
||||
if(myRequest != null) {
|
||||
if (myRequest != null) {
|
||||
myRequest.hideHint();
|
||||
myRequest = null;
|
||||
}
|
||||
@@ -100,7 +104,9 @@ public class ValueLookupManager implements EditorMouseMotionListener {
|
||||
|
||||
public void showHint(final QuickEvaluateHandler handler, Editor editor, Point point, ValueHintType type) {
|
||||
myAlarm.cancelAllRequests();
|
||||
if (editor.isDisposed() || !handler.canShowHint(myProject)) return;
|
||||
if (editor.isDisposed() || !handler.canShowHint(myProject)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final AbstractValueHint request = handler.createValueHint(myProject, editor, point, type);
|
||||
if (request != null) {
|
||||
@@ -108,8 +114,12 @@ public class ValueLookupManager implements EditorMouseMotionListener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!request.canShowHint()) return;
|
||||
if (myRequest != null && myRequest.isInsideHint(editor, point)) return;
|
||||
if (!request.canShowHint()) {
|
||||
return;
|
||||
}
|
||||
if (myRequest != null && myRequest.isInsideHint(editor, point)) {
|
||||
return;
|
||||
}
|
||||
|
||||
hideHint();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user