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

Unified Diff: pkg/analysis_server/tool/spec/implied_types.dart

Issue 483393002: Analysis server code generation improvements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | « pkg/analysis_server/tool/spec/codegen_dart_protocol.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/implied_types.dart
diff --git a/pkg/analysis_server/tool/spec/implied_types.dart b/pkg/analysis_server/tool/spec/implied_types.dart
index e37c0b4dc14cefa2f9262905742cfe50e2c1ce95..46abf23f9bae0d9614915c913dbc1d48d0dd0537 100644
--- a/pkg/analysis_server/tool/spec/implied_types.dart
+++ b/pkg/analysis_server/tool/spec/implied_types.dart
@@ -26,7 +26,12 @@ class ImpliedType {
*/
final String kind;
- ImpliedType(this.camelName, this.humanReadableName, this.type, this.kind);
+ /**
+ * API node from which this type was inferred.
+ */
+ final ApiNode apiNode;
+
+ ImpliedType(this.camelName, this.humanReadableName, this.type, this.kind, this.apiNode);
}
Map<String, ImpliedType> computeImpliedTypes(Api api) {
@@ -40,7 +45,8 @@ class _ImpliedTypesVisitor extends HierarchicalApiVisitor {
_ImpliedTypesVisitor(Api api) : super(api);
- void storeType(String name, String nameSuffix, TypeDecl type, String kind) {
+ void storeType(String name, String nameSuffix, TypeDecl type, String
+ kind, ApiNode apiNode) {
String humanReadableName = name;
List<String> camelNameParts = name.split('.');
if (nameSuffix != null) {
@@ -48,30 +54,37 @@ class _ImpliedTypesVisitor extends HierarchicalApiVisitor {
camelNameParts.add(nameSuffix);
}
String camelName = camelJoin(camelNameParts);
- impliedTypes[camelName] = new ImpliedType(camelName, humanReadableName, type, kind);
+ impliedTypes[camelName] = new ImpliedType(camelName, humanReadableName,
+ type, kind, apiNode);
}
@override
visitNotification(Notification notification) {
- storeType(notification.longEvent, 'params', notification.params, 'notificationParams');
+ storeType(notification.longEvent, 'params', notification.params,
+ 'notificationParams', notification);
}
@override
visitRequest(Request request) {
- storeType(request.longMethod, 'params', request.params, 'requestParams');
- storeType(request.longMethod, 'result', request.result, 'requestResult');
+ storeType(request.longMethod, 'params', request.params, 'requestParams',
+ request);
+ storeType(request.longMethod, 'result', request.result, 'requestResult',
+ request);
}
@override
visitRefactoring(Refactoring refactoring) {
String camelKind = camelJoin(refactoring.kind.toLowerCase().split('_'));
- storeType(camelKind, 'feedback', refactoring.feedback, 'refactoringFeedback');
- storeType(camelKind, 'options', refactoring.options, 'refactoringOptions');
+ storeType(camelKind, 'feedback', refactoring.feedback,
+ 'refactoringFeedback', refactoring);
+ storeType(camelKind, 'options', refactoring.options, 'refactoringOptions',
+ refactoring);
}
@override
visitTypeDefinition(TypeDefinition typeDefinition) {
- storeType(typeDefinition.name, null, typeDefinition.type, 'typeDefinition');
+ storeType(typeDefinition.name, null, typeDefinition.type, 'typeDefinition',
+ typeDefinition);
}
}
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_dart_protocol.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698