| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// **docgen** is a tool for creating machine readable representations of Dart | 5 /// **docgen** is a tool for creating machine readable representations of Dart |
| 6 /// code metadata, including: classes, members, comments and annotations. | 6 /// code metadata, including: classes, members, comments and annotations. |
| 7 /// | 7 /// |
| 8 /// docgen is run on a `.dart` file or a directory containing `.dart` files. | 8 /// docgen is run on a `.dart` file or a directory containing `.dart` files. |
| 9 /// | 9 /// |
| 10 /// $ dart docgen.dart [OPTIONS] [FILE/DIR] | 10 /// $ dart docgen.dart [OPTIONS] [FILE/DIR] |
| (...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 var mdnPath = path.join(root, 'utils/apidoc/mdn/database.json'); | 1541 var mdnPath = path.join(root, 'utils/apidoc/mdn/database.json'); |
| 1542 var mdnFile = new File(mdnPath); | 1542 var mdnFile = new File(mdnPath); |
| 1543 if (mdnFile.existsSync()) { | 1543 if (mdnFile.existsSync()) { |
| 1544 Indexable._mdn = JSON.decode(mdnFile.readAsStringSync()); | 1544 Indexable._mdn = JSON.decode(mdnFile.readAsStringSync()); |
| 1545 } else { | 1545 } else { |
| 1546 _Generator.logger.warning("Cannot find MDN docs expected at $mdnPath"); | 1546 _Generator.logger.warning("Cannot find MDN docs expected at $mdnPath"); |
| 1547 Indexable._mdn = {}; | 1547 Indexable._mdn = {}; |
| 1548 } | 1548 } |
| 1549 } | 1549 } |
| 1550 var domAnnotation = this.annotations.firstWhere( | 1550 var domAnnotation = this.annotations.firstWhere( |
| 1551 (e) => e.mirror.qualifiedName == 'metadata.DomName', | 1551 (e) => e.mirror.qualifiedName == #metadata.DomName, |
| 1552 orElse: () => null); | 1552 orElse: () => null); |
| 1553 if (domAnnotation == null) return ''; | 1553 if (domAnnotation == null) return ''; |
| 1554 var domName = domAnnotation.parameters.single; | 1554 var domName = domAnnotation.parameters.single; |
| 1555 var parts = domName.split('.'); | 1555 var parts = domName.split('.'); |
| 1556 if (parts.length == 2) return _mdnMemberComment(parts[0], parts[1]); | 1556 if (parts.length == 2) return _mdnMemberComment(parts[0], parts[1]); |
| 1557 if (parts.length == 1) return _mdnTypeComment(parts[0]); | 1557 if (parts.length == 1) return _mdnTypeComment(parts[0]); |
| 1558 } | 1558 } |
| 1559 | 1559 |
| 1560 String get packagePrefix => owner.packagePrefix; | 1560 String get packagePrefix => owner.packagePrefix; |
| 1561 } | 1561 } |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2164 .map((e) => originalMirror.getField(e.simpleName).reflectee) | 2164 .map((e) => originalMirror.getField(e.simpleName).reflectee) |
| 2165 .where((e) => e != null) | 2165 .where((e) => e != null) |
| 2166 .toList(); | 2166 .toList(); |
| 2167 } | 2167 } |
| 2168 | 2168 |
| 2169 Map toMap() => { | 2169 Map toMap() => { |
| 2170 'name': Indexable.getDocgenObject(mirror, owningLibrary).docName, | 2170 'name': Indexable.getDocgenObject(mirror, owningLibrary).docName, |
| 2171 'parameters': parameters | 2171 'parameters': parameters |
| 2172 }; | 2172 }; |
| 2173 } | 2173 } |
| OLD | NEW |