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

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

Issue 69883003: Issue 249. Show documentation for highlighted code completion. (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
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 71ed4ccf148691c3823acb366c1ba15956584b43..8dbd141a5125921fce0917d6109d0ff3ef7549b2 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
@@ -51,6 +51,28 @@ public class DartTextHover extends DefaultTextHover implements ITextHoverExtensi
hoverContributors.add(hoverContributor);
}
+ public static String getElementDocumentationHtml(Element element) {
+ if (element != null) {
+ String textSummary = DartDocUtilities.getTextSummaryAsHtml(element);
+
+ if (textSummary != null) {
+
+ StringBuffer docs = new StringBuffer();
+ docs.append("<b>" + textSummary + "</b>");
+
+ String dartdoc = DartDocUtilities.getDartDocAsHtml(element);
+
+ if (dartdoc != null) {
+ docs.append("<br><br>");
+ docs.append(dartdoc);
+ }
+
+ return docs.toString().trim();
+ }
+ }
+ return null;
+ }
+
/**
* Remove a hover contributor
*
@@ -168,25 +190,7 @@ public class DartTextHover extends DefaultTextHover implements ITextHoverExtensi
private String getDartDocHover(IRegion region) {
if (editor != null) {
Element element = NewSelectionConverter.getElementAtOffset(editor, region.getOffset());
-
- if (element != null) {
- String textSummary = DartDocUtilities.getTextSummaryAsHtml(element);
-
- if (textSummary != null) {
-
- StringBuffer docs = new StringBuffer();
- docs.append("<b>" + textSummary + "</b>");
-
- String dartdoc = DartDocUtilities.getDartDocAsHtml(element);
-
- if (dartdoc != null) {
- docs.append("<br><br>");
- docs.append(dartdoc);
- }
-
- return docs.toString().trim();
- }
- }
+ return getElementDocumentationHtml(element);
}
return null;

Powered by Google App Engine
This is Rietveld 408576698