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

Unified Diff: pkg/analysis_server/lib/src/computer/computer_hover.dart

Issue 1003193005: Add 'containingClassDescription' to HoverInformation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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: pkg/analysis_server/lib/src/computer/computer_hover.dart
diff --git a/pkg/analysis_server/lib/src/computer/computer_hover.dart b/pkg/analysis_server/lib/src/computer/computer_hover.dart
index 9cc2f41ec2be66d45c3b4268d5a019897c5f7a50..aad7ca3b0eab69d3a36893541ac285230c818735 100644
--- a/pkg/analysis_server/lib/src/computer/computer_hover.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_hover.dart
@@ -95,7 +95,13 @@ class DartUnitHoverComputer {
// description
hover.elementDescription = element.toString();
hover.elementKind = element.kind.displayName;
- // library
+ // containing class
+ ClassElement containingClass =
+ element.getAncestor((e) => e is ClassElement);
+ if (containingClass != null) {
+ hover.containingClassDescription = containingClass.toString();
+ }
+ // containing library
LibraryElement library = element.library;
if (library != null) {
hover.containingLibraryName = library.name;
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/generated_protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698