| 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/ast.dart'; |
| 15 import 'package:analyzer/dart/ast/token.dart'; | 16 import 'package:analyzer/dart/ast/token.dart'; |
| 17 import 'package:analyzer/dart/ast/visitor.dart'; |
| 16 import 'package:analyzer/dart/element/element.dart'; | 18 import 'package:analyzer/dart/element/element.dart'; |
| 17 import 'package:analyzer/dart/element/type.dart'; | 19 import 'package:analyzer/dart/element/type.dart'; |
| 18 import 'package:analyzer/src/dart/ast/token.dart'; | 20 import 'package:analyzer/src/dart/ast/token.dart'; |
| 21 import 'package:analyzer/src/dart/ast/utilities.dart'; |
| 19 import 'package:analyzer/src/dart/scanner/reader.dart'; | 22 import 'package:analyzer/src/dart/scanner/reader.dart'; |
| 20 import 'package:analyzer/src/dart/scanner/scanner.dart'; | 23 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
| 21 import 'package:analyzer/src/generated/ast.dart'; | |
| 22 import 'package:analyzer/src/generated/engine.dart'; | 24 import 'package:analyzer/src/generated/engine.dart'; |
| 23 import 'package:analyzer/src/generated/resolver.dart'; | 25 import 'package:analyzer/src/generated/resolver.dart'; |
| 24 import 'package:analyzer/src/generated/source.dart'; | 26 import 'package:analyzer/src/generated/source.dart'; |
| 25 import 'package:path/path.dart'; | 27 import 'package:path/path.dart'; |
| 26 | 28 |
| 27 /** | 29 /** |
| 28 * Adds edits to the given [change] that ensure that all the [libraries] are | 30 * Adds edits to the given [change] that ensure that all the [libraries] are |
| 29 * imported into the given [targetLibrary]. | 31 * imported into the given [targetLibrary]. |
| 30 */ | 32 */ |
| 31 void addLibraryImports(SourceChange change, LibraryElement targetLibrary, | 33 void addLibraryImports(SourceChange change, LibraryElement targetLibrary, |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 _InvertedCondition expr, int newOperatorPrecedence) { | 1521 _InvertedCondition expr, int newOperatorPrecedence) { |
| 1520 if (expr._precedence < newOperatorPrecedence) { | 1522 if (expr._precedence < newOperatorPrecedence) { |
| 1521 return "(${expr._source})"; | 1523 return "(${expr._source})"; |
| 1522 } | 1524 } |
| 1523 return expr._source; | 1525 return expr._source; |
| 1524 } | 1526 } |
| 1525 | 1527 |
| 1526 static _InvertedCondition _simple(String source) => | 1528 static _InvertedCondition _simple(String source) => |
| 1527 new _InvertedCondition(2147483647, source); | 1529 new _InvertedCondition(2147483647, source); |
| 1528 } | 1530 } |
| OLD | NEW |