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

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

Issue 1310263003: Reformat code to minimize churn (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 27 matching lines...) Expand all
38 return rangeNode(executableNode); 38 return rangeNode(executableNode);
39 } 39 }
40 // not a part of a declaration with locals 40 // not a part of a declaration with locals
41 return SourceRange.EMPTY; 41 return SourceRange.EMPTY;
42 } 42 }
43 43
44 /** 44 /**
45 * Returns the source which should replace given invocation with given 45 * Returns the source which should replace given invocation with given
46 * arguments. 46 * arguments.
47 */ 47 */
48 String _getMethodSourceForInvocation(RefactoringStatus status, _SourcePart part, 48 String _getMethodSourceForInvocation(
49 CorrectionUtils utils, AstNode contextNode, Expression targetExpression, 49 RefactoringStatus status,
50 _SourcePart part,
51 CorrectionUtils utils,
52 AstNode contextNode,
53 Expression targetExpression,
50 List<Expression> arguments) { 54 List<Expression> arguments) {
51 // prepare edits to replace parameters with arguments 55 // prepare edits to replace parameters with arguments
52 List<SourceEdit> edits = <SourceEdit>[]; 56 List<SourceEdit> edits = <SourceEdit>[];
53 part._parameters.forEach((ParameterElement parameter, 57 part._parameters.forEach(
54 List<_ParameterOccurrence> occurrences) { 58 (ParameterElement parameter, List<_ParameterOccurrence> occurrences) {
55 // prepare argument 59 // prepare argument
56 Expression argument = null; 60 Expression argument = null;
57 for (Expression arg in arguments) { 61 for (Expression arg in arguments) {
58 if (arg.bestParameterElement == parameter) { 62 if (arg.bestParameterElement == parameter) {
59 argument = arg; 63 argument = arg;
60 break; 64 break;
61 } 65 }
62 } 66 }
63 if (argument is NamedExpression) { 67 if (argument is NamedExpression) {
64 argument = (argument as NamedExpression).expression; 68 argument = (argument as NamedExpression).expression;
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 813 }
810 814
811 void _addVariable(SimpleIdentifier node) { 815 void _addVariable(SimpleIdentifier node) {
812 VariableElement variableElement = getLocalVariableElement(node); 816 VariableElement variableElement = getLocalVariableElement(node);
813 if (variableElement != null) { 817 if (variableElement != null) {
814 SourceRange nodeRange = rangeNode(node); 818 SourceRange nodeRange = rangeNode(node);
815 result.addVariable(variableElement, nodeRange); 819 result.addVariable(variableElement, nodeRange);
816 } 820 }
817 } 821 }
818 } 822 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698