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

Side by Side Diff: pkg/analyzer/lib/src/summary/summarize_elements.dart

Issue 1564343004: Add support for Element.docRange to the summary. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library serialization.elements; 5 library serialization.elements;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/dart/element/type.dart'; 8 import 'package:analyzer/dart/element/type.dart';
9 import 'package:analyzer/src/dart/element/type.dart'; 9 import 'package:analyzer/src/dart/element/type.dart';
10 import 'package:analyzer/src/generated/resolver.dart'; 10 import 'package:analyzer/src/generated/resolver.dart';
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 * Serialize documentation from the given [element], creating an 384 * Serialize documentation from the given [element], creating an
385 * [UnlinkedDocumentationComment]. 385 * [UnlinkedDocumentationComment].
386 * 386 *
387 * If [element] has no documentation, `null` is returned. 387 * If [element] has no documentation, `null` is returned.
388 */ 388 */
389 UnlinkedDocumentationCommentBuilder serializeDocumentation(Element element) { 389 UnlinkedDocumentationCommentBuilder serializeDocumentation(Element element) {
390 if (element.documentationComment == null) { 390 if (element.documentationComment == null) {
391 return null; 391 return null;
392 } 392 }
393 return encodeUnlinkedDocumentationComment(ctx, 393 return encodeUnlinkedDocumentationComment(ctx,
394 text: element.documentationComment); 394 text: element.documentationComment,
395 offset: element.docRange.offset,
396 length: element.docRange.length);
395 } 397 }
396 398
397 /** 399 /**
398 * Return the index of the entry in the references table 400 * Return the index of the entry in the references table
399 * ([UnlinkedLibrary.references] and [PrelinkedLibrary.references]) 401 * ([UnlinkedLibrary.references] and [PrelinkedLibrary.references])
400 * representing the pseudo-type `dynamic`. 402 * representing the pseudo-type `dynamic`.
401 */ 403 */
402 int serializeDynamicReference() => 0; 404 int serializeDynamicReference() => 0;
403 405
404 /** 406 /**
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 b.nameOffset = variable.nameOffset; 701 b.nameOffset = variable.nameOffset;
700 b.type = serializeTypeRef(variable.type, variable); 702 b.type = serializeTypeRef(variable.type, variable);
701 b.isStatic = variable.isStatic && variable.enclosingElement is ClassElement; 703 b.isStatic = variable.isStatic && variable.enclosingElement is ClassElement;
702 b.isFinal = variable.isFinal; 704 b.isFinal = variable.isFinal;
703 b.isConst = variable.isConst; 705 b.isConst = variable.isConst;
704 b.hasImplicitType = variable.hasImplicitType; 706 b.hasImplicitType = variable.hasImplicitType;
705 b.documentationComment = serializeDocumentation(variable); 707 b.documentationComment = serializeDocumentation(variable);
706 return b; 708 return b;
707 } 709 }
708 } 710 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698