Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: pkg/docgen/lib/docgen.dart

Issue 18242010: used lookupInScope(name) to find the qualified names in comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698