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

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

Issue 1689303002: Issue 25385. Set documentation comment for enum constants. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months 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/src/summary/summarize_ast.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index f552a87e8e050522b3b5dcd68d14f99da37ee82f..ce9ac979935c7c8b99ecfd36bee768a337d5d152 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -39,6 +39,7 @@ import 'package:analyzer/src/task/strong_mode.dart';
import 'package:analyzer/task/dart.dart';
import 'package:analyzer/task/general.dart';
import 'package:analyzer/task/model.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
/**
* The [ResultCachingPolicy] for ASTs.
@@ -1365,7 +1366,8 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask {
// set the library documentation to the docs associated with the first
// directive in the compilation unit.
if (definingCompilationUnit.directives.isNotEmpty) {
- _setDoc(libraryElement, definingCompilationUnit.directives.first);
+ setElementDocumentationComment(
+ libraryElement, definingCompilationUnit.directives.first);
}
//
@@ -1408,19 +1410,6 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask {
}
/**
- * If the given [node] has a documentation comment, remember its content
- * and range into the given [element].
- */
- void _setDoc(ElementImpl element, AnnotatedNode node) {
- Comment comment = node.documentationComment;
- if (comment != null && comment.isDocumentation) {
- element.documentationComment =
- comment.tokens.map((Token t) => t.lexeme).join('\n');
- element.setDocRange(comment.offset, comment.length);
- }
- }
-
- /**
* Return a map from the names of the inputs of this kind of task to the task
* input descriptors describing those inputs for a task with the given
* [libSource].
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698