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

Unified Diff: sdk/lib/_internal/dartdoc/lib/dartdoc.dart

Issue 18323004: Add lookupInScope to DeclarationMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased 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
Index: sdk/lib/_internal/dartdoc/lib/dartdoc.dart
diff --git a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
index 02748759b184659a1ffdc0ffaff37190aeb9138c..21f5d5eea316f7e49f3e15e7f5246a70dd9c06bf 100644
--- a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
+++ b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
@@ -975,7 +975,6 @@ class Dartdoc {
}
_totalLibraries++;
_currentLibrary = library;
- _currentType = null;
startFile(libraryUrl(library));
writeHeader('${displayName(library)} Library',
@@ -1032,6 +1031,8 @@ class Dartdoc {
docType(type);
}
+
+ _currentLibrary = null;
}
void docTypes(List types, String header) {
@@ -1102,6 +1103,8 @@ class Dartdoc {
writeTypeFooter();
writeFooter();
endFile();
+
+ _currentType = null;
}
/** Override this to write additional content at the end of a type's page. */
@@ -1575,6 +1578,8 @@ class Dartdoc {
writeln('</div>');
writeln('</div>');
+
+ _currentMember = null;
}
void docField(ContainerMirror host, VariableMirror field,
@@ -1660,6 +1665,8 @@ class Dartdoc {
writeln('</div>');
writeln('</div>');
+
+ _currentMember = null;
}
void docParamList(ContainerMirror enclosingType,
@@ -2012,6 +2019,23 @@ class Dartdoc {
return anchor;
}
+ DeclarationMirror declaration = currentMember;
+ if (declaration == null) declaration = currentType;
+ if (declaration == null) declaration = currentLibrary;
+ if (declaration != null) {
+ declaration = lookupQualifiedInScope(declaration, name);
+ }
+
+ if (declaration != null) {
+ if (declaration is TypeVariableMirror) {
+ return makeLink(typeUrl(declaration.owner));
+ } if (declaration is TypeMirror) {
+ return makeLink(typeUrl(declaration));
+ } else if (declaration is MethodMirror) {
+ return makeLink(memberUrl(declaration));
+ }
+ }
+
// See if it's a parameter of the current method.
if (currentMember is MethodMirror) {
for (final parameter in currentMember.parameters) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698