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

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

Issue 1131423002: Clean up many generated constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment change Created 5 years, 7 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 | Annotate | Revision Log
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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 RefactoringStatus _prepareMethod() { 317 RefactoringStatus _prepareMethod() {
318 _methodElement = null; 318 _methodElement = null;
319 _methodParameters = null; 319 _methodParameters = null;
320 _methodBody = null; 320 _methodBody = null;
321 deleteSource = false; 321 deleteSource = false;
322 inlineAll = false; 322 inlineAll = false;
323 // prepare for failure 323 // prepare for failure
324 RefactoringStatus fatalStatus = new RefactoringStatus.fatal( 324 RefactoringStatus fatalStatus = new RefactoringStatus.fatal(
325 'Method declaration or reference must be selected to activate this refac toring.'); 325 'Method declaration or reference must be selected to activate this refac toring.');
326 // prepare selected SimpleIdentifier 326 // prepare selected SimpleIdentifier
327 AstNode node = new NodeLocator.con1(offset).searchWithin(unit); 327 AstNode node = new NodeLocator(offset).searchWithin(unit);
328 if (node is! SimpleIdentifier) { 328 if (node is! SimpleIdentifier) {
329 return fatalStatus; 329 return fatalStatus;
330 } 330 }
331 SimpleIdentifier identifier = node as SimpleIdentifier; 331 SimpleIdentifier identifier = node as SimpleIdentifier;
332 // prepare selected ExecutableElement 332 // prepare selected ExecutableElement
333 Element element = identifier.bestElement; 333 Element element = identifier.bestElement;
334 if (element is! ExecutableElement) { 334 if (element is! ExecutableElement) {
335 return fatalStatus; 335 return fatalStatus;
336 } 336 }
337 if (element.isSynthetic) { 337 if (element.isSynthetic) {
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 809 }
810 810
811 void _addVariable(SimpleIdentifier node) { 811 void _addVariable(SimpleIdentifier node) {
812 VariableElement variableElement = getLocalVariableElement(node); 812 VariableElement variableElement = getLocalVariableElement(node);
813 if (variableElement != null) { 813 if (variableElement != null) {
814 SourceRange nodeRange = rangeNode(node); 814 SourceRange nodeRange = rangeNode(node);
815 result.addVariable(variableElement, nodeRange); 815 result.addVariable(variableElement, nodeRange);
816 } 816 }
817 } 817 }
818 } 818 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698