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

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

Issue 21877009: Fixed docgen to work on files without the SDK (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 8a182b08d525d68bdd770951dd0acaf1aa0232fd..2343817fb5d882cfa0e6bda7b986cc5ef8c9b19c 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -97,8 +97,8 @@ Future<bool> docgen(List<String> files, {String packageRoot,
if (mirrorSystem.libraries.isEmpty) {
throw new StateError('No library mirrors were created.');
}
- _documentLibraries(mirrorSystem.libraries.values,
- includeSdk: includeSdk, outputToYaml: outputToYaml, append: append);
+ _documentLibraries(mirrorSystem.libraries.values,includeSdk: includeSdk,
+ outputToYaml: outputToYaml, append: append, parseSdk: parseSdk);
return true;
});
@@ -200,8 +200,8 @@ Future<MirrorSystem> _analyzeLibraries(List<String> libraries,
/**
* Creates documentation for filtered libraries.
*/
-void _documentLibraries(List<LibraryMirror> libs,
- {bool includeSdk: false, bool outputToYaml: true, bool append: false}) {
+void _documentLibraries(List<LibraryMirror> libs, {bool includeSdk: false,
+ bool outputToYaml: true, bool append: false, bool parseSdk: false}) {
libs.forEach((lib) {
// Files belonging to the SDK have a uri that begins with 'dart:'.
if (includeSdk || !lib.uri.toString().startsWith('dart:')) {
@@ -213,8 +213,8 @@ void _documentLibraries(List<LibraryMirror> libs,
// intermediate classes created by mixins are included.
entityMap.values.where((e) => e is Class).forEach((c) => c.makeValid());
// Everything is a subclass of Object, therefore empty the list to avoid a
- // giant list of subclasses to be printed out.
- entityMap['dart.core.Object'].subclasses.clear();
+ // giant list of subclasses to be printed out.
+ if (parseSdk) entityMap['dart.core.Object'].subclasses.clear();
var filteredEntities = entityMap.values.where(_isVisible);
// Output libraries and classes to file after all information is generated.
« 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