Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartTextHover.java

Issue 86073004: Issue 14868. Show both errors/warnings and Dart doc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartTextHover.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartTextHover.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartTextHover.java
index 8dbd141a5125921fce0917d6109d0ff3ef7549b2..1f6c6ddceb955791ea8bc68ebbe21824fe5186f4 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartTextHover.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartTextHover.java
@@ -82,6 +82,16 @@ public class DartTextHover extends DefaultTextHover implements ITextHoverExtensi
hoverContributors.remove(hoverContributor);
}
+ private static StringBuilder append(StringBuilder buffer, String s) {
+ if (buffer.length() != 0) {
+ buffer.append("<br><br>");
+ }
+ if (s != null) {
+ buffer.append(s);
+ }
+ return buffer;
+ }
+
private CompilationUnitEditor editor;
private DartSourceViewerConfiguration sourceViewerConfiguration;
@@ -139,12 +149,11 @@ public class DartTextHover extends DefaultTextHover implements ITextHoverExtensi
// means trying to call getHoverInfo2() on any contributors, and falling back on getHoverInfo().
lastReturnedHover = null;
- // Return any annotation info - i.e. errors and warnings.
- String annotationHover = super.getHoverInfo(textViewer, region);
+ StringBuilder buffer = new StringBuilder();
- if (annotationHover != null) {
- return escapeHtmlEntities(annotationHover);
- }
+ // Append any annotation info - i.e. errors and warnings.
+ String annotationHover = super.getHoverInfo(textViewer, region);
+ append(buffer, escapeHtmlEntities(annotationHover));
// Check through the contributed hover providers.
for (ITextHover hoverContributer : hoverContributors) {
@@ -155,7 +164,6 @@ public class DartTextHover extends DefaultTextHover implements ITextHoverExtensi
if (hoverInfo != null) {
lastReturnedHover = hoverContributer;
-
return hoverInfo;
}
} else {
@@ -163,14 +171,14 @@ public class DartTextHover extends DefaultTextHover implements ITextHoverExtensi
if (hoverText != null) {
lastReturnedHover = hoverContributer;
-
return hoverText;
}
}
}
// Check for a dartdoc contribution.
- return getDartDocHover(region);
+ String dartDocHover = getDartDocHover(region);
+ return append(buffer, dartDocHover).toString();
}
@Override
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698