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

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

Issue 923623002: Issue 20050. Show corrections for errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months 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/DartHover.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartHover.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartHover.java
index 27d6bae1af88402a20d1868a7fbb9f7ff098a377..00f6d6c60b63b5730a66ead0807977d371d01774 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartHover.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartHover.java
@@ -107,12 +107,28 @@ public class DartHover implements ITextHover, ITextHoverExtension, ITextHoverExt
}
annotations = getSortedAnnotations(annotations);
for (Annotation annotation : annotations) {
- Label imageLabel = new Label(container, SWT.NONE);
+ // prepare marker
+ IMarker marker = null;
if (annotation instanceof MarkerAnnotation) {
- IMarker marker = ((MarkerAnnotation) annotation).getMarker();
- imageLabel.setImage(ProblemsView.LABEL_PROVIDER.getImage(marker));
+ marker = ((MarkerAnnotation) annotation).getMarker();
}
+ // icon
+ {
+ Label imageLabel = new Label(container, SWT.NONE);
+ if (marker != null) {
+ imageLabel.setImage(ProblemsView.DESCRIPTION_LABEL_PROVIDER.getImage(marker));
+ }
+ }
+ // message
toolkit.createLabel(container, annotation.getText());
+ // correction
+ if (marker != null) {
+ String correction = marker.getAttribute(DartCore.MARKER_ATTR_CORRECTION, (String) null);
+ if (correction != null) {
+ new Label(container, SWT.NONE);
+ toolkit.createLabel(container, correction);
+ }
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698