| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |