Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart

Issue 1693083004: Move scanner out of generated and clean up imports (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: clean up Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698