| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /** | 5 /** |
| 6 * To use it, from this directory, run: | 6 * To use it, from this directory, run: |
| 7 * | 7 * |
| 8 * $ dartdoc <path to .dart file> | 8 * $ dartdoc <path to .dart file> |
| 9 * | 9 * |
| 10 * This will create a "docs" directory with the docs for your libraries. To | 10 * This will create a "docs" directory with the docs for your libraries. To |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 /** Writes a link to a human-friendly string representation for a type. */ | 619 /** Writes a link to a human-friendly string representation for a type. */ |
| 620 linkToType(Type enclosingType, Type type) { | 620 linkToType(Type enclosingType, Type type) { |
| 621 if (type is ParameterType) { | 621 if (type is ParameterType) { |
| 622 // If we're using a type parameter within the body of a generic class then | 622 // If we're using a type parameter within the body of a generic class then |
| 623 // just link back up to the class. | 623 // just link back up to the class. |
| 624 write(a(typeUrl(enclosingType), type.name)); | 624 write(a(typeUrl(enclosingType), type.name)); |
| 625 return; | 625 return; |
| 626 } | 626 } |
| 627 | 627 |
| 628 // Link to the type. | 628 // Link to the type. |
| 629 write(a(typeUrl(type), type.name)); | 629 // Use .genericType to avoid writing the <...> here. |
| 630 write(a(typeUrl(type), type.genericType.name)); |
| 630 | 631 |
| 631 // See if it's a generic type. | 632 // See if it's a generic type. |
| 632 if (type.isGeneric) { | 633 if (type.isGeneric) { |
| 633 // TODO(rnystrom): This relies on a weird corner case of frog. Currently, | 634 // TODO(rnystrom): This relies on a weird corner case of frog. Currently, |
| 634 // the only time we get into this case is when we have a "raw" generic | 635 // the only time we get into this case is when we have a "raw" generic |
| 635 // that's been instantiated with Dynamic for all type arguments. It's kind | 636 // that's been instantiated with Dynamic for all type arguments. It's kind |
| 636 // of strange that frog works that way, but we take advantage of it to | 637 // of strange that frog works that way, but we take advantage of it to |
| 637 // show raw types without any type arguments. | 638 // show raw types without any type arguments. |
| 638 return; | 639 return; |
| 639 } | 640 } |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 } | 890 } |
| 890 | 891 |
| 891 /** Register a callback to add additional documentation to a type. */ | 892 /** Register a callback to add additional documentation to a type. */ |
| 892 addTypeDocumenter(TypeDocumenter fn) => _typeDocumenters.add(fn); | 893 addTypeDocumenter(TypeDocumenter fn) => _typeDocumenters.add(fn); |
| 893 | 894 |
| 894 /** Register a callback to add additional documentation to a method. */ | 895 /** Register a callback to add additional documentation to a method. */ |
| 895 addMethodDocumenter(MethodDocumenter fn) => _methodDocumenters.add(fn); | 896 addMethodDocumenter(MethodDocumenter fn) => _methodDocumenters.add(fn); |
| 896 | 897 |
| 897 /** Register a callback to add additional documentation to a field. */ | 898 /** Register a callback to add additional documentation to a field. */ |
| 898 addFieldDocumenter(FieldDocumenter fn) => _fieldDocumenters.add(fn); | 899 addFieldDocumenter(FieldDocumenter fn) => _fieldDocumenters.add(fn); |
| OLD | NEW |