| 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.statement_analyzer; | 5 library services.src.correction.statement_analyzer; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol_server.dart'; | 7 import 'package:analysis_server/src/protocol_server.dart'; |
| 8 import 'package:analysis_server/src/services/correction/selection_analyzer.dart'
; | 8 import 'package:analysis_server/src/services/correction/selection_analyzer.dart'
; |
| 9 import 'package:analysis_server/src/services/correction/source_range.dart'; | 9 import 'package:analysis_server/src/services/correction/source_range.dart'; |
| 10 import 'package:analysis_server/src/services/correction/status.dart'; | 10 import 'package:analysis_server/src/services/correction/status.dart'; |
| 11 import 'package:analysis_server/src/services/correction/util.dart'; | 11 import 'package:analysis_server/src/services/correction/util.dart'; |
| 12 import 'package:analyzer/dart/ast/token.dart'; |
| 12 import 'package:analyzer/dart/element/element.dart'; | 13 import 'package:analyzer/dart/element/element.dart'; |
| 14 import 'package:analyzer/src/dart/scanner/reader.dart'; |
| 15 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
| 13 import 'package:analyzer/src/generated/ast.dart'; | 16 import 'package:analyzer/src/generated/ast.dart'; |
| 14 import 'package:analyzer/src/generated/scanner.dart'; | |
| 15 import 'package:analyzer/src/generated/source.dart'; | 17 import 'package:analyzer/src/generated/source.dart'; |
| 16 | 18 |
| 17 /** | 19 /** |
| 18 * Returns [Token]s of the given Dart source, not `null`, may be empty if no | 20 * Returns [Token]s of the given Dart source, not `null`, may be empty if no |
| 19 * tokens or some exception happens. | 21 * tokens or some exception happens. |
| 20 */ | 22 */ |
| 21 List<Token> _getTokens(String text) { | 23 List<Token> _getTokens(String text) { |
| 22 try { | 24 try { |
| 23 List<Token> tokens = <Token>[]; | 25 List<Token> tokens = <Token>[]; |
| 24 Scanner scanner = new Scanner(null, new CharSequenceReader(text), null); | 26 Scanner scanner = new Scanner(null, new CharSequenceReader(text), null); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 */ | 221 */ |
| 220 static bool _containsAny(List<AstNode> nodes, List<AstNode> otherNodes) { | 222 static bool _containsAny(List<AstNode> nodes, List<AstNode> otherNodes) { |
| 221 for (AstNode otherNode in otherNodes) { | 223 for (AstNode otherNode in otherNodes) { |
| 222 if (nodes.contains(otherNode)) { | 224 if (nodes.contains(otherNode)) { |
| 223 return true; | 225 return true; |
| 224 } | 226 } |
| 225 } | 227 } |
| 226 return false; | 228 return false; |
| 227 } | 229 } |
| 228 } | 230 } |
| OLD | NEW |