Chromium Code Reviews| 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..f13b92ddef509563c2339d3cc3991880a152f87c 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() => _docComment; |
| @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 |
| @@ -3794,6 +3807,7 @@ class MultiplyDefinedElementImpl implements MultiplyDefinedElement { |
| } |
| } |
| + // TODO: implement documentationComment |
|
scheglov
2015/12/17 22:10:14
Did you want to fix this in this CL?
pquitslund
2015/12/17 22:12:56
Whoops! Yes. Thanks!
|
| /** |
| * Use the given elements to construct a list of conflicting elements. If |
| * either the [firstElement] or [secondElement] are multiply-defined elements |
| @@ -4226,7 +4240,8 @@ class PropertyAccessorElementImpl extends ExecutableElementImpl |
| } |
| @override |
| - bool operator ==(Object object) => super == object && |
| + bool operator ==(Object object) => |
| + super == object && |
| isGetter == (object as PropertyAccessorElement).isGetter; |
| @override |