| 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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 } | 939 } |
| 940 // prepare element | 940 // prepare element |
| 941 Element element = type.element; | 941 Element element = type.element; |
| 942 if (element == null) { | 942 if (element == null) { |
| 943 String source = type.toString(); | 943 String source = type.toString(); |
| 944 source = source.replaceAll('<dynamic>', ''); | 944 source = source.replaceAll('<dynamic>', ''); |
| 945 source = source.replaceAll('<dynamic, dynamic>', ''); | 945 source = source.replaceAll('<dynamic, dynamic>', ''); |
| 946 return source; | 946 return source; |
| 947 } | 947 } |
| 948 // check if imported | 948 // check if imported |
| 949 { | 949 if (element.library != _library) { |
| 950 ImportElement importElement = _getImportElement(element); | 950 ImportElement importElement = _getImportElement(element); |
| 951 if (importElement != null) { | 951 if (importElement != null) { |
| 952 if (importElement.prefix != null) { | 952 if (importElement.prefix != null) { |
| 953 sb.write(importElement.prefix.displayName); | 953 sb.write(importElement.prefix.displayName); |
| 954 sb.write("."); | 954 sb.write("."); |
| 955 } | 955 } |
| 956 } else { | 956 } else { |
| 957 librariesToImport.add(element.library); | 957 librariesToImport.add(element.library); |
| 958 } | 958 } |
| 959 } | 959 } |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 | 1450 |
| 1451 @override | 1451 @override |
| 1452 Object visitExpression(Expression node) { | 1452 Object visitExpression(Expression node) { |
| 1453 if (node is BinaryExpression && node.operator.type == groupOperatorType) { | 1453 if (node is BinaryExpression && node.operator.type == groupOperatorType) { |
| 1454 return super.visitNode(node); | 1454 return super.visitNode(node); |
| 1455 } | 1455 } |
| 1456 operands.add(node); | 1456 operands.add(node); |
| 1457 return null; | 1457 return null; |
| 1458 } | 1458 } |
| 1459 } | 1459 } |
| OLD | NEW |