Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1534043002: Cache element docs (and add to completions) (#23694). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweaks Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/dart/element/element.dart ('k') | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « pkg/analyzer/lib/dart/element/element.dart ('k') | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698