Index: pkg/analyzer/lib/src/dart/element/element.dart |
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart |
index 7d5164e2470d1c437a16d4b431f8f80b2673a5f6..ff3986823980880bd0ee10c2e968a1c042c1a6b6 100644 |
--- a/pkg/analyzer/lib/src/dart/element/element.dart |
+++ b/pkg/analyzer/lib/src/dart/element/element.dart |
@@ -1673,6 +1673,11 @@ abstract class ElementImpl implements Element { |
ElementLocation _cachedLocation; |
/** |
+ * The documentation comment for this element. |
+ */ |
+ String _docComment; |
+ |
+ /** |
* The offset to the beginning of the documentation comment, |
* or `null` if this element does not have a documentation comment. |
*/ |
@@ -1717,6 +1722,16 @@ abstract class ElementImpl implements Element { |
} |
@override |
+ String get documentationComment => _docComment; |
+ |
+ /** |
+ * The documentation comment source for this element. |
+ */ |
+ void set documentationComment(String doc) { |
+ _docComment = doc?.replaceAll('\r\n', '\n'); |
+ } |
+ |
+ @override |
Element get enclosingElement => _enclosingElement; |
/** |
@@ -1866,13 +1881,7 @@ abstract class ElementImpl implements Element { |
} |
@override |
- String computeDocumentationComment() { |
- AnalysisContext context = this.context; |
- if (context == null) { |
- return null; |
- } |
- return context.computeDocumentationComment(this); |
- } |
+ String computeDocumentationComment() => documentationComment; |
@override |
AstNode computeNode() => getNodeMatching((node) => node is AstNode); |
@@ -3236,7 +3245,8 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement { |
} |
@override |
- bool operator ==(Object object) => object is LibraryElementImpl && |
+ bool operator ==(Object object) => |
+ object is LibraryElementImpl && |
_definingCompilationUnit == object.definingCompilationUnit; |
@override |
@@ -3658,6 +3668,9 @@ class MultiplyDefinedElementImpl implements MultiplyDefinedElement { |
SourceRange get docRange => null; |
@override |
+ String get documentationComment => null; |
+ |
+ @override |
Element get enclosingElement => null; |
@override |
@@ -4226,7 +4239,8 @@ class PropertyAccessorElementImpl extends ExecutableElementImpl |
} |
@override |
- bool operator ==(Object object) => super == object && |
+ bool operator ==(Object object) => |
+ super == object && |
isGetter == (object as PropertyAccessorElement).isGetter; |
@override |