| 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' | 9 import 'package:analysis_server/src/protocol.dart' |
| 10 show SourceChange, SourceEdit; | 10 show SourceChange, SourceEdit; |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 Element element = type.element; | 994 Element element = type.element; |
| 995 if (element == null) { | 995 if (element == null) { |
| 996 String source = type.toString(); | 996 String source = type.toString(); |
| 997 source = source.replaceAll('<dynamic>', ''); | 997 source = source.replaceAll('<dynamic>', ''); |
| 998 source = source.replaceAll('<dynamic, dynamic>', ''); | 998 source = source.replaceAll('<dynamic, dynamic>', ''); |
| 999 return source; | 999 return source; |
| 1000 } | 1000 } |
| 1001 // check if imported | 1001 // check if imported |
| 1002 LibraryElement library = element.library; | 1002 LibraryElement library = element.library; |
| 1003 if (library != null && library != _library) { | 1003 if (library != null && library != _library) { |
| 1004 // no source, if private |
| 1005 if (element.isPrivate) { |
| 1006 return null; |
| 1007 } |
| 1008 // ensure import |
| 1004 ImportElement importElement = _getImportElement(element); | 1009 ImportElement importElement = _getImportElement(element); |
| 1005 if (importElement != null) { | 1010 if (importElement != null) { |
| 1006 if (importElement.prefix != null) { | 1011 if (importElement.prefix != null) { |
| 1007 sb.write(importElement.prefix.displayName); | 1012 sb.write(importElement.prefix.displayName); |
| 1008 sb.write("."); | 1013 sb.write("."); |
| 1009 } | 1014 } |
| 1010 } else { | 1015 } else { |
| 1011 librariesToImport.add(library); | 1016 librariesToImport.add(library); |
| 1012 } | 1017 } |
| 1013 } | 1018 } |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 | 1506 |
| 1502 @override | 1507 @override |
| 1503 Object visitExpression(Expression node) { | 1508 Object visitExpression(Expression node) { |
| 1504 if (node is BinaryExpression && node.operator.type == groupOperatorType) { | 1509 if (node is BinaryExpression && node.operator.type == groupOperatorType) { |
| 1505 return super.visitNode(node); | 1510 return super.visitNode(node); |
| 1506 } | 1511 } |
| 1507 operands.add(node); | 1512 operands.add(node); |
| 1508 return null; | 1513 return null; |
| 1509 } | 1514 } |
| 1510 } | 1515 } |
| OLD | NEW |