| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library computer.hover; | 5 library computer.hover; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/protocol/protocol.dart' | 7 import 'package:analysis_server/plugin/protocol/protocol.dart' |
| 8 show HoverInformation; | 8 show HoverInformation; |
| 9 import 'package:analysis_server/src/computer/computer_overrides.dart'; | 9 import 'package:analysis_server/src/computer/computer_overrides.dart'; |
| 10 import 'package:analysis_server/src/utilities/documentation.dart'; | 10 import 'package:analysis_server/src/utilities/documentation.dart'; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // variable, if synthetic accessor | 49 // variable, if synthetic accessor |
| 50 if (element is PropertyAccessorElement) { | 50 if (element is PropertyAccessorElement) { |
| 51 PropertyAccessorElement accessor = element; | 51 PropertyAccessorElement accessor = element; |
| 52 if (accessor.isSynthetic) { | 52 if (accessor.isSynthetic) { |
| 53 element = accessor.variable; | 53 element = accessor.variable; |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 // description | 56 // description |
| 57 hover.elementDescription = element.toString(); | 57 hover.elementDescription = element.toString(); |
| 58 hover.elementKind = element.kind.displayName; | 58 hover.elementKind = element.kind.displayName; |
| 59 hover.isDeprecated = element.isDeprecated; |
| 59 // not local element | 60 // not local element |
| 60 if (element.enclosingElement is! ExecutableElement) { | 61 if (element.enclosingElement is! ExecutableElement) { |
| 61 // containing class | 62 // containing class |
| 62 ClassElement containingClass = | 63 ClassElement containingClass = |
| 63 element.getAncestor((e) => e is ClassElement); | 64 element.getAncestor((e) => e is ClassElement); |
| 64 if (containingClass != null) { | 65 if (containingClass != null) { |
| 65 hover.containingClassDescription = containingClass.displayName; | 66 hover.containingClassDescription = containingClass.displayName; |
| 66 } | 67 } |
| 67 // containing library | 68 // containing library |
| 68 LibraryElement library = element.library; | 69 LibraryElement library = element.library; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 Element interfaceClass = superElement.enclosingElement; | 123 Element interfaceClass = superElement.enclosingElement; |
| 123 return removeDartDocDelimiters(rawDoc) + | 124 return removeDartDocDelimiters(rawDoc) + |
| 124 '\n\nCopied from `${interfaceClass.displayName}`.'; | 125 '\n\nCopied from `${interfaceClass.displayName}`.'; |
| 125 } | 126 } |
| 126 } | 127 } |
| 127 return null; | 128 return null; |
| 128 } | 129 } |
| 129 | 130 |
| 130 static _safeToString(obj) => obj?.toString(); | 131 static _safeToString(obj) => obj?.toString(); |
| 131 } | 132 } |
| OLD | NEW |