| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library services.src.correction.util; | 5 library services.src.correction.util; |
| 6 | 6 |
| 7 import 'dart:math'; | 7 import 'dart:math'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' show SourceChange, | 9 import 'package:analysis_server/src/protocol.dart' show SourceChange, |
| 10 SourceEdit; | 10 SourceEdit; |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 /** | 870 /** |
| 871 * @return the source for the parameter with the given type and name. | 871 * @return the source for the parameter with the given type and name. |
| 872 */ | 872 */ |
| 873 String getParameterSource(DartType type, String name, | 873 String getParameterSource(DartType type, String name, |
| 874 Set<LibraryElement> librariesToImport) { | 874 Set<LibraryElement> librariesToImport) { |
| 875 // no type | 875 // no type |
| 876 if (type == null || type.isDynamic) { | 876 if (type == null || type.isDynamic) { |
| 877 return name; | 877 return name; |
| 878 } | 878 } |
| 879 // function type | 879 // function type |
| 880 if (type is FunctionType) { | 880 if (type is FunctionType && type.element.isSynthetic) { |
| 881 FunctionType functionType = type; | 881 FunctionType functionType = type; |
| 882 StringBuffer sb = new StringBuffer(); | 882 StringBuffer sb = new StringBuffer(); |
| 883 // return type | 883 // return type |
| 884 DartType returnType = functionType.returnType; | 884 DartType returnType = functionType.returnType; |
| 885 if (returnType != null && !returnType.isDynamic) { | 885 if (returnType != null && !returnType.isDynamic) { |
| 886 String returnTypeSource = getTypeSource(returnType, librariesToImport); | 886 String returnTypeSource = getTypeSource(returnType, librariesToImport); |
| 887 sb.write(returnTypeSource); | 887 sb.write(returnTypeSource); |
| 888 sb.write(' '); | 888 sb.write(' '); |
| 889 } | 889 } |
| 890 // parameter name | 890 // parameter name |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 | 1468 |
| 1469 @override | 1469 @override |
| 1470 Object visitExpression(Expression node) { | 1470 Object visitExpression(Expression node) { |
| 1471 if (node is BinaryExpression && node.operator.type == groupOperatorType) { | 1471 if (node is BinaryExpression && node.operator.type == groupOperatorType) { |
| 1472 return super.visitNode(node); | 1472 return super.visitNode(node); |
| 1473 } | 1473 } |
| 1474 operands.add(node); | 1474 operands.add(node); |
| 1475 return null; | 1475 return null; |
| 1476 } | 1476 } |
| 1477 } | 1477 } |
| OLD | NEW |