| 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.models.method; | 5 library docgen.models.method; |
| 6 | 6 |
| 7 import 'package:markdown/markdown.dart' as markdown; | 7 import 'package:markdown/markdown.dart' as markdown; |
| 8 | 8 |
| 9 import '../exports/mirrors_util.dart' as dart2js_util; | 9 import '../exports/mirrors_util.dart' as dart2js_util; |
| 10 import '../exports/source_mirrors.dart'; | 10 import '../exports/source_mirrors.dart'; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 String get docName { | 85 String get docName { |
| 86 if (mirror.isConstructor) { | 86 if (mirror.isConstructor) { |
| 87 // We name constructors specially -- including the class name again and a | 87 // We name constructors specially -- including the class name again and a |
| 88 // "-" to separate the constructor from its name (if any). | 88 // "-" to separate the constructor from its name (if any). |
| 89 return '${owner.docName}.${dart2js_util.nameOf(mirror.owner)}-' | 89 return '${owner.docName}.${dart2js_util.nameOf(mirror.owner)}-' |
| 90 '${dart2js_util.nameOf(mirror)}'; | 90 '${dart2js_util.nameOf(mirror)}'; |
| 91 } | 91 } |
| 92 return super.docName; | 92 return super.docName; |
| 93 } | 93 } |
| 94 | 94 |
| 95 String get fileName => packagePrefix + docName; | 95 String get qualifiedName => packagePrefix + docName; |
| 96 | 96 |
| 97 /// Makes sure that the method with an inherited equivalent have comments. | 97 /// Makes sure that the method with an inherited equivalent have comments. |
| 98 void ensureCommentFor(Method inheritedMethod) { | 98 void ensureCommentFor(Method inheritedMethod) { |
| 99 if (comment.isNotEmpty) return; | 99 if (comment.isNotEmpty) return; |
| 100 | 100 |
| 101 comment = inheritedMethod.commentToHtml(this); | 101 comment = inheritedMethod.commentToHtml(this); |
| 102 unresolvedComment = inheritedMethod.unresolvedComment; | 102 unresolvedComment = inheritedMethod.unresolvedComment; |
| 103 commentInheritedFrom = inheritedMethod.commentInheritedFrom == '' ? | 103 commentInheritedFrom = inheritedMethod.commentInheritedFrom == '' ? |
| 104 new DummyMirror(inheritedMethod.mirror).docName : | 104 new DummyMirror(inheritedMethod.mirror).docName : |
| 105 inheritedMethod.commentInheritedFrom; | 105 inheritedMethod.commentInheritedFrom; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 linkResolver: fixReference, inlineSyntaxes: MARKDOWN_SYNTAXES); | 147 linkResolver: fixReference, inlineSyntaxes: MARKDOWN_SYNTAXES); |
| 148 commentInheritedFrom = comment != '' ? | 148 commentInheritedFrom = comment != '' ? |
| 149 methodInheritedFrom.commentInheritedFrom : ''; | 149 methodInheritedFrom.commentInheritedFrom : ''; |
| 150 result = comment; | 150 result = comment; |
| 151 } | 151 } |
| 152 return result; | 152 return result; |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool isValidMirror(DeclarationMirror mirror) => mirror is MethodMirror; | 155 bool isValidMirror(DeclarationMirror mirror) => mirror is MethodMirror; |
| 156 } | 156 } |
| OLD | NEW |