| 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/plugin/protocol/protocol.dart' | 9 import 'package:analysis_server/plugin/protocol/protocol.dart' |
| 10 show SourceChange, SourceEdit; | 10 show SourceChange, SourceEdit; |
| 11 import 'package:analysis_server/src/protocol_server.dart' | 11 import 'package:analysis_server/src/protocol_server.dart' |
| 12 show doSourceChange_addElementEdit; | 12 show doSourceChange_addElementEdit; |
| 13 import 'package:analysis_server/src/services/correction/source_range.dart'; | 13 import 'package:analysis_server/src/services/correction/source_range.dart'; |
| 14 import 'package:analysis_server/src/services/correction/strings.dart'; | 14 import 'package:analysis_server/src/services/correction/strings.dart'; |
| 15 import 'package:analyzer/dart/ast/token.dart'; |
| 15 import 'package:analyzer/dart/element/element.dart'; | 16 import 'package:analyzer/dart/element/element.dart'; |
| 16 import 'package:analyzer/dart/element/type.dart'; | 17 import 'package:analyzer/dart/element/type.dart'; |
| 18 import 'package:analyzer/src/dart/ast/token.dart'; |
| 19 import 'package:analyzer/src/dart/scanner/reader.dart'; |
| 20 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
| 17 import 'package:analyzer/src/generated/ast.dart'; | 21 import 'package:analyzer/src/generated/ast.dart'; |
| 18 import 'package:analyzer/src/generated/engine.dart'; | 22 import 'package:analyzer/src/generated/engine.dart'; |
| 19 import 'package:analyzer/src/generated/resolver.dart'; | 23 import 'package:analyzer/src/generated/resolver.dart'; |
| 20 import 'package:analyzer/src/generated/scanner.dart'; | |
| 21 import 'package:analyzer/src/generated/source.dart'; | 24 import 'package:analyzer/src/generated/source.dart'; |
| 22 import 'package:path/path.dart'; | 25 import 'package:path/path.dart'; |
| 23 | 26 |
| 24 /** | 27 /** |
| 25 * Adds edits to the given [change] that ensure that all the [libraries] are | 28 * Adds edits to the given [change] that ensure that all the [libraries] are |
| 26 * imported into the given [targetLibrary]. | 29 * imported into the given [targetLibrary]. |
| 27 */ | 30 */ |
| 28 void addLibraryImports(SourceChange change, LibraryElement targetLibrary, | 31 void addLibraryImports(SourceChange change, LibraryElement targetLibrary, |
| 29 Set<LibraryElement> libraries) { | 32 Set<LibraryElement> libraries) { |
| 30 CompilationUnitElement libUnitElement = targetLibrary.definingCompilationUnit; | 33 CompilationUnitElement libUnitElement = targetLibrary.definingCompilationUnit; |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 _InvertedCondition expr, int newOperatorPrecedence) { | 1519 _InvertedCondition expr, int newOperatorPrecedence) { |
| 1517 if (expr._precedence < newOperatorPrecedence) { | 1520 if (expr._precedence < newOperatorPrecedence) { |
| 1518 return "(${expr._source})"; | 1521 return "(${expr._source})"; |
| 1519 } | 1522 } |
| 1520 return expr._source; | 1523 return expr._source; |
| 1521 } | 1524 } |
| 1522 | 1525 |
| 1523 static _InvertedCondition _simple(String source) => | 1526 static _InvertedCondition _simple(String source) => |
| 1524 new _InvertedCondition(2147483647, source); | 1527 new _InvertedCondition(2147483647, source); |
| 1525 } | 1528 } |
| OLD | NEW |