| 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();
|
|
|