Chromium Code Reviews| Index: pkg/docgen/lib/docgen.dart |
| diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart |
| index 76cb0bb6299763dfc982b338b18e3a770246973f..7885343311c5b7432ea7aacbbcdf268169f0dc24 100644 |
| --- a/pkg/docgen/lib/docgen.dart |
| +++ b/pkg/docgen/lib/docgen.dart |
| @@ -60,7 +60,7 @@ markdown.Resolver linkResolver; |
| * If [parseSdk] is 'true', then all Dart SDK libraries will be documented. |
| * This option is useful when only the SDK libraries are needed. |
| * |
| - * Returns true if docgen sucessfuly completes. |
| + * Returns 'true' if docgen sucessfuly completes. |
|
Emily Fortuna
2013/07/09 20:21:36
I think you could use the backtick (`) instead, si
janicejl
2013/07/10 01:16:40
Done.
|
| */ |
| Future<bool> docgen(List<String> files, {String packageRoot, |
| bool outputToYaml: true, bool includePrivate: false, bool includeSdk: false, |
| @@ -274,11 +274,23 @@ String _getComment(DeclarationMirror mirror) { |
| /** |
| * Converts all [_] references in comments to <code>_</code>. |
|
Emily Fortuna
2013/07/09 20:21:36
nit: can we change this comment to say "Converts a
janicejl
2013/07/10 01:16:40
Done.
|
| */ |
| -// TODO(tmandel): Create proper links for [_] style markdown based |
| -// on scope once layout of viewer is finished. |
| markdown.Node fixReference(String name, LibraryMirror currentLibrary, |
| ClassMirror currentClass, MemberMirror currentMember) { |
| - return new markdown.Element.text('code', name); |
| + |
| + var reference; |
| + var memberScope = currentMember == null ? |
| + null : currentMember.lookupInScope(name); |
| + if (memberScope != null) reference = memberScope.qualifiedName; |
| + else { |
| + var classScope = currentClass == null ? |
| + null : currentClass.lookupInScope(name); |
| + if (classScope != null) reference = classScope.qualifiedName; |
| + else { |
| + var libraryScope = currentLibrary.lookupInScope(name); |
| + reference = libraryScope != null ? libraryScope.qualifiedname : name; |
| + } |
| + } |
| + return new markdown.Element.text('a', reference); |
| } |
| /** |