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 'dart:convert'; | 7 import 'dart:convert'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 * Serialize documentation from the given [element], creating an | 714 * Serialize documentation from the given [element], creating an |
715 * [UnlinkedDocumentationComment]. | 715 * [UnlinkedDocumentationComment]. |
716 * | 716 * |
717 * If [element] has no documentation, `null` is returned. | 717 * If [element] has no documentation, `null` is returned. |
718 */ | 718 */ |
719 UnlinkedDocumentationCommentBuilder serializeDocumentation(Element element) { | 719 UnlinkedDocumentationCommentBuilder serializeDocumentation(Element element) { |
720 if (element.documentationComment == null) { | 720 if (element.documentationComment == null) { |
721 return null; | 721 return null; |
722 } | 722 } |
723 return new UnlinkedDocumentationCommentBuilder( | 723 return new UnlinkedDocumentationCommentBuilder( |
724 text: element.documentationComment, | 724 text: element.documentationComment); |
725 offset: element.docRange.offset, | |
726 length: element.docRange.length); | |
727 } | 725 } |
728 | 726 |
729 /** | 727 /** |
730 * Serialize the given [enumElement], creating an [UnlinkedEnum]. | 728 * Serialize the given [enumElement], creating an [UnlinkedEnum]. |
731 */ | 729 */ |
732 UnlinkedEnumBuilder serializeEnum(ClassElement enumElement) { | 730 UnlinkedEnumBuilder serializeEnum(ClassElement enumElement) { |
733 UnlinkedEnumBuilder b = new UnlinkedEnumBuilder(); | 731 UnlinkedEnumBuilder b = new UnlinkedEnumBuilder(); |
734 b.name = enumElement.name; | 732 b.name = enumElement.name; |
735 b.nameOffset = enumElement.nameOffset; | 733 b.nameOffset = enumElement.nameOffset; |
736 List<UnlinkedEnumValueBuilder> values = <UnlinkedEnumValueBuilder>[]; | 734 List<UnlinkedEnumValueBuilder> values = <UnlinkedEnumValueBuilder>[]; |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1712 exportNames.add(new LinkedExportNameBuilder( | 1710 exportNames.add(new LinkedExportNameBuilder( |
1713 name: name, | 1711 name: name, |
1714 dependency: serializeDependency(dependentLibrary), | 1712 dependency: serializeDependency(dependentLibrary), |
1715 unit: unit, | 1713 unit: unit, |
1716 kind: kind)); | 1714 kind: kind)); |
1717 } | 1715 } |
1718 pb.exportNames = exportNames; | 1716 pb.exportNames = exportNames; |
1719 return pb; | 1717 return pb; |
1720 } | 1718 } |
1721 } | 1719 } |
OLD | NEW |