Index: pkg/analyzer/lib/src/context/context.dart |
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart |
index 32590d98d48d3474249f1f491dbbe3ad6a2be2e5..c9604ef38f0e7b42ed6c5f8b7d1ba687e7aefcc7 100644 |
--- a/pkg/analyzer/lib/src/context/context.dart |
+++ b/pkg/analyzer/lib/src/context/context.dart |
@@ -558,22 +558,8 @@ class AnalysisContextImpl implements InternalAnalysisContext { |
} |
@override |
- String computeDocumentationComment(Element element) { |
- if (element == null) { |
- return null; |
- } |
- Source source = element.source; |
- if (source == null) { |
- return null; |
- } |
- SourceRange docRange = element.docRange; |
- if (docRange == null) { |
- return null; |
- } |
- String code = getContents(source).data; |
- String comment = code.substring(docRange.offset, docRange.end); |
- return comment.replaceAll('\r\n', '\n'); |
- } |
+ String computeDocumentationComment(Element element) => |
+ element?.documentationComment; |
@override |
List<AnalysisError> computeErrors(Source source) { |