| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 docgen.model_helpers; | 5 library docgen.model_helpers; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import '../exports/dart2js_mirrors.dart' as dart2js_mirrors; | 9 import '../exports/dart2js_mirrors.dart' as dart2js_mirrors; |
| 10 import '../exports/mirrors_util.dart' as dart2js_util; | 10 import '../exports/mirrors_util.dart' as dart2js_util; |
| 11 import '../exports/source_mirrors.dart'; | 11 import '../exports/source_mirrors.dart'; |
| 12 import '../exports/libraries.dart'; | 12 import '../exports/libraries.dart'; |
| 13 | 13 |
| 14 import '../library_helpers.dart' show includePrivateMembers; | 14 import '../library_helpers.dart' show includePrivateMembers; |
| 15 import '../package_helpers.dart'; | 15 import '../package_helpers.dart'; |
| 16 | 16 |
| 17 import 'annotation.dart'; | 17 import 'annotation.dart'; |
| 18 import 'generic.dart'; | 18 import 'generic.dart'; |
| 19 import 'indexable.dart'; | 19 import 'indexable.dart'; |
| 20 import 'library.dart'; | 20 import 'library.dart'; |
| 21 import 'method.dart'; | 21 import 'method.dart'; |
| 22 import 'parameter.dart'; | 22 import 'parameter.dart'; |
| 23 import 'variable.dart'; | 23 import 'variable.dart'; |
| 24 | 24 |
| 25 String getLibraryDocName(LibraryMirror mirror) => | 25 String getLibraryDocName(LibraryMirror mirror) { |
| 26 dart2js_util.qualifiedNameOf(mirror).replaceAll('.', '-'); | 26 var dotsFixed = dart2js_util.qualifiedNameOf(mirror).replaceAll('.', '-'); |
| 27 if (dotsFixed.startsWith('dart-dom-')) { |
| 28 return dotsFixed.replaceFirst("dart-dom-", "dart:"); |
| 29 } else if (dotsFixed.startsWith("dart-")) { |
| 30 return dotsFixed.replaceFirst("dart-", "dart:"); |
| 31 } else { |
| 32 return dotsFixed; |
| 33 } |
| 34 } |
| 27 | 35 |
| 28 /// Expand the method map [mapToExpand] into a more detailed map that | 36 /// Expand the method map [mapToExpand] into a more detailed map that |
| 29 /// separates out setters, getters, constructors, operators, and methods. | 37 /// separates out setters, getters, constructors, operators, and methods. |
| 30 Map expandMethodMap(Map<String, Method> mapToExpand) => { | 38 Map expandMethodMap(Map<String, Method> mapToExpand) => { |
| 31 'setters': recurseMap(_filterMap(mapToExpand, | 39 'setters': recurseMap(_filterMap(mapToExpand, |
| 32 (key, val) => val.mirror.isSetter)), | 40 (key, val) => val.mirror.isSetter)), |
| 33 'getters': recurseMap(_filterMap(mapToExpand, | 41 'getters': recurseMap(_filterMap(mapToExpand, |
| 34 (key, val) => val.mirror.isGetter)), | 42 (key, val) => val.mirror.isGetter)), |
| 35 'constructors': recurseMap(_filterMap(mapToExpand, | 43 'constructors': recurseMap(_filterMap(mapToExpand, |
| 36 (key, val) => val.mirror.isConstructor)), | 44 (key, val) => val.mirror.isConstructor)), |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // the time. | 260 // the time. |
| 253 var sdkLibrary = LIBRARIES[dart2js_util.nameOf(mirror)]; | 261 var sdkLibrary = LIBRARIES[dart2js_util.nameOf(mirror)]; |
| 254 if (sdkLibrary != null) { | 262 if (sdkLibrary != null) { |
| 255 return !sdkLibrary.documented; | 263 return !sdkLibrary.documented; |
| 256 } else if (dart2js_util.nameOf(mirror).startsWith('_') || dart2js_util.nameOf( | 264 } else if (dart2js_util.nameOf(mirror).startsWith('_') || dart2js_util.nameOf( |
| 257 mirror).contains('._')) { | 265 mirror).contains('._')) { |
| 258 return true; | 266 return true; |
| 259 } | 267 } |
| 260 return false; | 268 return false; |
| 261 } | 269 } |
| OLD | NEW |