From 015f552876828e2a5de46c10a2889371c15f7514 Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 15 Jan 2013 14:04:48 +0100 Subject: [PATCH] show tooltips for all infos in editor as it is done on right gutter (IDEA-99011) --- .../daemon/impl/DaemonCodeAnalyzerImpl.java | 14 +++++++++++++- .../codeInsight/daemon/impl/StatusBarUpdater.java | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java index 8d7657c6c0ff..d846748b8e0b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java @@ -598,12 +598,24 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx @Nullable public HighlightInfo findHighlightByOffset(@NotNull Document document, final int offset, final boolean includeFixRange) { + return findHighlightByOffset(document, offset, includeFixRange, true); + } + + @Nullable + public HighlightInfo findHighlightByOffset(@NotNull Document document, + final int offset, + final boolean includeFixRange, + final boolean includeAllButInformation) { final List foundInfoList = new SmartList(); processHighlightsNearOffset(document, myProject, HighlightSeverity.INFORMATION, offset, includeFixRange, new Processor() { @Override public boolean process(@NotNull HighlightInfo info) { - if (!foundInfoList.isEmpty()) { + if (includeAllButInformation) { + if (HighlightSeverity.INFORMATION.compareTo(info.getSeverity()) >= 0) { + return true; + } + } else if (!foundInfoList.isEmpty()) { HighlightInfo foundInfo = foundInfoList.get(0); int compare = foundInfo.getSeverity().compareTo(info.getSeverity()); if (compare < 0) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/StatusBarUpdater.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/StatusBarUpdater.java index 814cde78a24c..26d64974c326 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/StatusBarUpdater.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/StatusBarUpdater.java @@ -94,7 +94,7 @@ public class StatusBarUpdater implements Disposable { int offset = editor.getCaretModel().getOffset(); DaemonCodeAnalyzer codeAnalyzer = DaemonCodeAnalyzer.getInstance(myProject); - HighlightInfo info = ((DaemonCodeAnalyzerImpl)codeAnalyzer).findHighlightByOffset(document, offset, false); + HighlightInfo info = ((DaemonCodeAnalyzerImpl)codeAnalyzer).findHighlightByOffset(document, offset, false, false); String text = info != null && info.description != null ? info.description : ""; StatusBar statusBar = WindowManager.getInstance().getStatusBar(editor.getContentComponent(), myProject);