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

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

Issue 1050983002: Tweaks for hover - local variables and methods. (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
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/get_hover_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 aad7ca3b0eab69d3a36893541ac285230c818735..ceafb22e96360cabdfad3e1f4e0575b0feb9ab36 100644
--- a/pkg/analysis_server/lib/src/computer/computer_hover.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_hover.dart
@@ -95,17 +95,20 @@ class DartUnitHoverComputer {
// description
hover.elementDescription = element.toString();
hover.elementKind = element.kind.displayName;
- // 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;
- hover.containingLibraryPath = library.source.fullName;
+ // not local element
+ if (element.enclosingElement is! ExecutableElement) {
+ // 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;
+ hover.containingLibraryPath = library.source.fullName;
+ }
}
// documentation
String dartDoc = element.computeDocumentationComment();
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/get_hover_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698