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

Side by Side Diff: pkg/analyzer_plugin/tool/spec/codegen_protocol_common.dart

Issue 3002293003: Convert GeneratedContent to async and use AnalysisDriver for tasks graph. (Closed)
Patch Set: Created 3 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:analyzer/src/codegen/tools.dart'; 5 import 'package:analyzer/src/codegen/tools.dart';
6 import 'package:path/path.dart' as path; 6 import 'package:path/path.dart' as path;
7 7
8 import 'api.dart'; 8 import 'api.dart';
9 import 'codegen_dart_protocol.dart'; 9 import 'codegen_dart_protocol.dart';
10 import 'from_html.dart'; 10 import 'from_html.dart';
11 import 'implied_types.dart'; 11 import 'implied_types.dart';
12 12
13 GeneratedFile target(bool responseRequiresRequestTime) => 13 GeneratedFile target(bool responseRequiresRequestTime) =>
14 new GeneratedFile('lib/protocol/protocol_common.dart', (String pkgPath) { 14 new GeneratedFile('lib/protocol/protocol_common.dart',
15 (String pkgPath) async {
15 CodegenCommonVisitor visitor = new CodegenCommonVisitor( 16 CodegenCommonVisitor visitor = new CodegenCommonVisitor(
16 path.basename(pkgPath), 17 path.basename(pkgPath),
17 responseRequiresRequestTime, 18 responseRequiresRequestTime,
18 readApi(pkgPath)); 19 readApi(pkgPath));
19 return visitor.collectCode(visitor.visitApi); 20 return visitor.collectCode(visitor.visitApi);
20 }); 21 });
21 22
22 /** 23 /**
23 * A visitor that produces Dart code defining the common types associated with 24 * A visitor that produces Dart code defining the common types associated with
24 * the API. 25 * the API.
(...skipping 22 matching lines...) Expand all
47 List<ImpliedType> getClassesToEmit() { 48 List<ImpliedType> getClassesToEmit() {
48 List<ImpliedType> types = impliedTypes.values.where((ImpliedType type) { 49 List<ImpliedType> types = impliedTypes.values.where((ImpliedType type) {
49 ApiNode node = type.apiNode; 50 ApiNode node = type.apiNode;
50 return node is TypeDefinition && node.isExternal; 51 return node is TypeDefinition && node.isExternal;
51 }).toList(); 52 }).toList();
52 types.sort((first, second) => 53 types.sort((first, second) =>
53 capitalize(first.camelName).compareTo(capitalize(second.camelName))); 54 capitalize(first.camelName).compareTo(capitalize(second.camelName)));
54 return types; 55 return types;
55 } 56 }
56 } 57 }
OLDNEW
« no previous file with comments | « pkg/analyzer_plugin/tool/spec/codegen_matchers.dart ('k') | pkg/analyzer_plugin/tool/spec/codegen_protocol_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698