| OLD | NEW |
| 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 'dart:convert'; | 5 import 'dart:convert'; |
| 6 | 6 |
| 7 import 'package:analyzer/src/codegen/tools.dart'; | 7 import 'package:analyzer/src/codegen/tools.dart'; |
| 8 import 'package:html/dom.dart' as dom; | 8 import 'package:html/dom.dart' as dom; |
| 9 | 9 |
| 10 import 'api.dart'; | 10 import 'api.dart'; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 }); | 216 }); |
| 217 toHtmlVisitor.p(() { | 217 toHtmlVisitor.p(() { |
| 218 toHtmlVisitor.write(disclaimer); | 218 toHtmlVisitor.write(disclaimer); |
| 219 }); | 219 }); |
| 220 })); | 220 })); |
| 221 write('class $className'); | 221 write('class $className'); |
| 222 if (impliedType.kind == 'refactoringFeedback') { | 222 if (impliedType.kind == 'refactoringFeedback') { |
| 223 writeln(' extends RefactoringFeedback implements HasToJson {'); | 223 writeln(' extends RefactoringFeedback implements HasToJson {'); |
| 224 } else if (impliedType.kind == 'refactoringOptions') { | 224 } else if (impliedType.kind == 'refactoringOptions') { |
| 225 writeln(' extends RefactoringOptions implements HasToJson {'); | 225 writeln(' extends RefactoringOptions implements HasToJson {'); |
| 226 } else if (impliedType.kind == 'requestParams') { | |
| 227 writeln(' implements RequestParams {'); | |
| 228 } else if (impliedType.kind == 'requestResult') { | 226 } else if (impliedType.kind == 'requestResult') { |
| 229 writeln(' implements ResponseResult {'); | 227 writeln(' implements ResponseResult {'); |
| 230 } else { | 228 } else { |
| 231 writeln(' {'); | 229 writeln(' {'); |
| 232 } | 230 } |
| 233 indent(() { | 231 indent(() { |
| 234 if (impliedType.kind == 'requestResult') { | 232 if (impliedType.kind == 'requestResult') { |
| 235 emitEmptyToJsonMember(); | 233 emitEmptyToJsonMember(); |
| 236 writeln(); | 234 writeln(); |
| 237 } | 235 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 398 } |
| 401 toHtmlVisitor.p(() { | 399 toHtmlVisitor.p(() { |
| 402 toHtmlVisitor.write(disclaimer); | 400 toHtmlVisitor.write(disclaimer); |
| 403 }); | 401 }); |
| 404 })); | 402 })); |
| 405 write('class $className'); | 403 write('class $className'); |
| 406 if (impliedType.kind == 'refactoringFeedback') { | 404 if (impliedType.kind == 'refactoringFeedback') { |
| 407 writeln(' extends RefactoringFeedback {'); | 405 writeln(' extends RefactoringFeedback {'); |
| 408 } else if (impliedType.kind == 'refactoringOptions') { | 406 } else if (impliedType.kind == 'refactoringOptions') { |
| 409 writeln(' extends RefactoringOptions {'); | 407 writeln(' extends RefactoringOptions {'); |
| 410 } else if (impliedType.kind == 'requestParams') { | |
| 411 writeln(' implements RequestParams {'); | |
| 412 } else if (impliedType.kind == 'requestResult') { | 408 } else if (impliedType.kind == 'requestResult') { |
| 413 writeln(' implements ResponseResult {'); | 409 writeln(' implements ResponseResult {'); |
| 414 } else { | 410 } else { |
| 415 writeln(' implements HasToJson {'); | 411 writeln(' implements HasToJson {'); |
| 416 } | 412 } |
| 417 indent(() { | 413 indent(() { |
| 418 if (emitSpecialStaticMembers(className)) { | 414 if (emitSpecialStaticMembers(className)) { |
| 419 writeln(); | 415 writeln(); |
| 420 } | 416 } |
| 421 for (TypeObjectField field in type.fields) { | 417 for (TypeObjectField field in type.fields) { |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 | 1267 |
| 1272 @override | 1268 @override |
| 1273 String get asClosure => '($type value) => ${callback('value')}'; | 1269 String get asClosure => '($type value) => ${callback('value')}'; |
| 1274 | 1270 |
| 1275 @override | 1271 @override |
| 1276 bool get isIdentity => false; | 1272 bool get isIdentity => false; |
| 1277 | 1273 |
| 1278 @override | 1274 @override |
| 1279 String asSnippet(String value) => callback(value); | 1275 String asSnippet(String value) => callback(value); |
| 1280 } | 1276 } |
| OLD | NEW |