don't show information tooltip: other implementation (IDEA-CR-18014)

This commit is contained in:
Anna.Kozlova
2017-02-14 13:41:08 +01:00
parent 5aa12ad9eb
commit 7340a915ca
2 changed files with 11 additions and 4 deletions
@@ -18,7 +18,6 @@ package com.intellij.codeInsight.daemon.impl;
import com.intellij.codeInsight.hint.TooltipController;
import com.intellij.codeInsight.hint.TooltipGroup;
import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.editor.Editor;
import com.intellij.ui.HintHint;
import org.jetbrains.annotations.NotNull;
@@ -46,7 +45,6 @@ public class DaemonTooltipUtil {
public static void showInfoTooltip(@NotNull final HighlightInfo info, @NotNull Editor editor, final int defaultOffset, final int currentWidth, final boolean requestFocus) {
if (info.getToolTip() == null) return;
if (HighlightSeverity.INFORMATION.equals(info.getSeverity())) return;
Rectangle visibleArea = editor.getScrollingModel().getVisibleArea();
Point bestPoint = editor.logicalPositionToXY(editor.offsetToLogicalPosition(defaultOffset));
@@ -355,13 +355,22 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
.range(psiElement, textRange.getStartOffset(), textRange.getEndOffset())
.description(message)
.severity(severity);
if (toolTip != null) b.escapedToolTip(toolTip);
boolean invisible = HighlightSeverity.INFORMATION.equals(severity);
if (toolTip != null && !invisible) b.escapedToolTip(toolTip);
if (attributes != null) b.textAttributes(attributes);
if (problemDescriptor.isAfterEndOfLine()) b.endOfLine();
if (isFileLevel) b.fileLevelAnnotation();
if (problemDescriptor.getProblemGroup() != null) b.problemGroup(problemDescriptor.getProblemGroup());
if (!invisible) return b.create();
return b.create();
HighlightInfo info = b.createUnconditionally();
for (HighlightInfoFilter filter : HighlightInfoFilter.EXTENSION_POINT_NAME.getExtensions()) {
if (!(filter instanceof HighlightInfoFilterImpl) && !filter.accept(info, myFile)) {
return null;
}
}
info.psiElement = psiElement;
return info;
}
private final Map<TextRange, RangeMarker> ranges2markersCache = new THashMap<>();