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

Side by Side Diff: pkg/analysis_server/lib/src/services/refactoring/inline_method.dart

Issue 1855643002: More strong mode changes to analysis_server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Backout changes to options file Created 4 years, 8 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.refactoring.inline_method; 5 library services.src.refactoring.inline_method;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol_server.dart' hide Element; 9 import 'package:analysis_server/src/protocol_server.dart' hide Element;
10 import 'package:analysis_server/src/services/correction/source_range.dart'; 10 import 'package:analysis_server/src/services/correction/source_range.dart';
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // done 273 // done
274 return new Future.value(result); 274 return new Future.value(result);
275 } 275 }
276 276
277 @override 277 @override
278 Future<RefactoringStatus> checkInitialConditions() async { 278 Future<RefactoringStatus> checkInitialConditions() async {
279 RefactoringStatus result = new RefactoringStatus(); 279 RefactoringStatus result = new RefactoringStatus();
280 // prepare method information 280 // prepare method information
281 result.addStatus(_prepareMethod()); 281 result.addStatus(_prepareMethod());
282 if (result.hasFatalError) { 282 if (result.hasFatalError) {
283 return new Future.value(result); 283 return new Future<RefactoringStatus>.value(result);
284 } 284 }
285 // maybe operator 285 // maybe operator
286 if (_methodElement.isOperator) { 286 if (_methodElement.isOperator) {
287 result = new RefactoringStatus.fatal('Cannot inline operator.'); 287 result = new RefactoringStatus.fatal('Cannot inline operator.');
288 return new Future.value(result); 288 return new Future<RefactoringStatus>.value(result);
289 } 289 }
290 // analyze method body 290 // analyze method body
291 result.addStatus(_prepareMethodParts()); 291 result.addStatus(_prepareMethodParts());
292 // process references 292 // process references
293 List<SearchMatch> references = 293 List<SearchMatch> references =
294 await searchEngine.searchReferences(_methodElement); 294 await searchEngine.searchReferences(_methodElement);
295 _referenceProcessors.clear(); 295 _referenceProcessors.clear();
296 for (SearchMatch reference in references) { 296 for (SearchMatch reference in references) {
297 _ReferenceProcessor processor = new _ReferenceProcessor(this, reference); 297 _ReferenceProcessor processor = new _ReferenceProcessor(this, reference);
298 _referenceProcessors.add(processor); 298 _referenceProcessors.add(processor);
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 } 825 }
826 826
827 void _addVariable(SimpleIdentifier node) { 827 void _addVariable(SimpleIdentifier node) {
828 VariableElement variableElement = getLocalVariableElement(node); 828 VariableElement variableElement = getLocalVariableElement(node);
829 if (variableElement != null) { 829 if (variableElement != null) {
830 SourceRange nodeRange = rangeNode(node); 830 SourceRange nodeRange = rangeNode(node);
831 result.addVariable(variableElement, nodeRange); 831 result.addVariable(variableElement, nodeRange);
832 } 832 }
833 } 833 }
834 } 834 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698