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

Unified Diff: utils/dartdoc/files.dart

Issue 9146016: Add the ability to link to members and constructors of other classes in Dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Get tests running again. Created 8 years, 11 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 | « utils/dartdoc/dartdoc.dart ('k') | utils/tests/dartdoc/src/dartdoc_tests.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/dartdoc/files.dart
diff --git a/utils/dartdoc/files.dart b/utils/dartdoc/files.dart
index a51c78c33ad8918d31178ca5bde874839c1266c3..d76f1e3361caa26035241ca4f08e8acf8b455c37 100644
--- a/utils/dartdoc/files.dart
+++ b/utils/dartdoc/files.dart
@@ -69,7 +69,12 @@ typeUrl(Type type) {
}
/** Gets the URL for the documentation for [member]. */
-memberUrl(Member member) => '${typeUrl(member.declaringType)}#${member.name}';
+memberUrl(Member member) {
+ final typeUrl = typeUrl(member.declaringType);
+ if (!member.isConstructor) return '$typeUrl#${member.name}';
+ if (member.constructorName == '') return '$typeUrl#new:${member.name}';
+ return '$typeUrl#new:${member.name}.${member.constructorName}';
+}
/** Gets the anchor id for the document for [member]. */
memberAnchor(Member member) => '${member.name}';
« no previous file with comments | « utils/dartdoc/dartdoc.dart ('k') | utils/tests/dartdoc/src/dartdoc_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698