show tooltips for all infos in editor as it is done on right gutter (IDEA-99011)

This commit is contained in:
anna
2013-01-15 17:08:28 +01:00
parent c6d9ef59ad
commit 015f552876
2 changed files with 14 additions and 2 deletions
@@ -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<HighlightInfo> foundInfoList = new SmartList<HighlightInfo>();
processHighlightsNearOffset(document, myProject, HighlightSeverity.INFORMATION, offset, includeFixRange,
new Processor<HighlightInfo>() {
@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) {
@@ -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);