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

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

Issue 18653005: Docgen returning a future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 dd5ae22b2663fbe0bd14208532c462bd02d033c5..5989a7a7d2dcd2831c2f8c4d32267050dbccedde 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -60,10 +60,16 @@ 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.
Emily Fortuna 2013/07/03 20:24:40 can we add some documentation explaining what a re
janicejl 2013/07/03 21:25:08 Done.
*/
-void docgen(List<String> files, {String packageRoot, bool outputToYaml: true,
- bool includePrivate: false, bool includeSdk: false, bool parseSdk: false}) {
+Future<bool> docgen(List<String> files, {String packageRoot,
+ bool outputToYaml: true, bool includePrivate: false, bool includeSdk: false,
+ bool parseSdk: false}) {
+ var docgenResult = new Completer<bool>();
Andrei Mouravski 2013/07/03 20:19:00 You can do this without a completer. Also, you don
Andrei Mouravski 2013/07/03 21:04:52 Sorry, was trying to reply quickly. You can just
janicejl 2013/07/03 21:25:08 Done.
+
if (packageRoot == null && !parseSdk) {
- packageRoot = _findPackageRoot(files.first);
+ if (FileSystemEntity.typeSync(files.first)
Andrei Mouravski 2013/07/03 20:19:00 Why do you do this?
janicejl 2013/07/03 21:25:08 To only pass in a directory. Before we were only s
Andrei Mouravski 2013/07/03 21:27:50 Um, okay. This code needs to be tested a bunch (no
janicejl 2013/07/03 21:46:45 Done.
+ == FileSystemEntityType.DIRECTORY) {
+ packageRoot = _findPackageRoot(files.first);
+ }
}
logger.info('Package Root: ${packageRoot}');
@@ -78,7 +84,10 @@ void docgen(List<String> files, {String packageRoot, bool outputToYaml: true,
_documentLibraries(mirrorSystem.libraries.values,
includeSdk: includeSdk, includePrivate: includePrivate,
outputToYaml: outputToYaml);
- });
+ }).then((e) => docgenResult.complete(true))
+ .catchError((e) => docgenResult.complete(false));
+
+ return docgenResult.future;
}
List<String> _listLibraries(List<String> args) {
« 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