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

Unified Diff: pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart

Issue 2679093004: Add an interface for request parameters (Closed)
Patch Set: Created 3 years, 10 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/analyzer_plugin/lib/src/protocol/protocol_internal.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart
diff --git a/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart b/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart
index 285f0961cb818389354d4a6501e1e77faf770af1..4357acb4369bb6fbf6d09dda72d9e697af7970b4 100644
--- a/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart
+++ b/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart
@@ -223,13 +223,16 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator {
writeln(' extends RefactoringFeedback implements HasToJson {');
} else if (impliedType.kind == 'refactoringOptions') {
writeln(' extends RefactoringOptions implements HasToJson {');
+ } else if (impliedType.kind == 'requestParams') {
+ writeln(' implements RequestParams {');
} else if (impliedType.kind == 'requestResult') {
writeln(' implements ResponseResult {');
} else {
writeln(' {');
}
indent(() {
- if (impliedType.kind == 'requestResult') {
+ if (impliedType.kind == 'requestResult' ||
+ impliedType.kind == 'requestParams') {
emitEmptyToJsonMember();
writeln();
}
@@ -405,6 +408,8 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator {
writeln(' extends RefactoringFeedback {');
} else if (impliedType.kind == 'refactoringOptions') {
writeln(' extends RefactoringOptions {');
+ } else if (impliedType.kind == 'requestParams') {
+ writeln(' implements RequestParams {');
} else if (impliedType.kind == 'requestResult') {
writeln(' implements ResponseResult {');
} else {
@@ -910,6 +915,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator {
*/
bool emitToRequestMember(ImpliedType impliedType) {
if (impliedType.kind == 'requestParams') {
+ writeln('@override');
writeln('Request toRequest(String id) {');
indent(() {
String methodString =
« no previous file with comments | « pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698