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

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..182a4fc54ddc68b8f6245dc4ca65450014077374 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -278,7 +278,21 @@ String _getComment(DeclarationMirror mirror) {
// on scope once layout of viewer is finished.
Tate Mandel 2013/07/09 16:43:26 Remove this TODO.
janicejl 2013/07/09 19:49:21 Done.
markdown.Node fixReference(String name, LibraryMirror currentLibrary,
ClassMirror currentClass, MemberMirror currentMember) {
- return new markdown.Element.text('code', name);
+
+ var reference;
+ var libraryScope = currentLibrary.lookupInScope(name);
Tate Mandel 2013/07/09 16:43:26 I feel as though it should go the other way around
janicejl 2013/07/09 19:49:21 Done.
+ if (libraryScope != null) reference = libraryScope.qualifiedName;
+ else {
+ var classScope = currentClass == null ?
+ null : currentClass.lookupInScope(name);
+ if (classScope != null) reference = classScope.qualifiedName;
+ else {
+ var memberScope = currentMember == null ?
+ null : currentMember.lookupInScope(name);
+ reference = memberScope != null ? memberScope.qualifiedname : name;
+ }
+ }
+ return new markdown.Element.text('code', reference);
Tate Mandel 2013/07/09 16:43:26 We probably don't want this as a <code> tag anymor
janicejl 2013/07/09 19:49:21 Done.
}
/**
« 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