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

Unified Diff: pkg/analysis_server/lib/src/services/refactoring/inline_local.dart

Issue 969113002: Reformat (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/services/refactoring/inline_local.dart
diff --git a/pkg/analysis_server/lib/src/services/refactoring/inline_local.dart b/pkg/analysis_server/lib/src/services/refactoring/inline_local.dart
index 064021a3094852b7728d8f11521b57c32a427d8a..a9b6e7919902fb6c08b3fb6d571d6587f12c460e 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/inline_local.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/inline_local.dart
@@ -19,12 +19,11 @@ import 'package:analyzer/src/generated/java_core.dart';
import 'package:analyzer/src/generated/scanner.dart';
import 'package:analyzer/src/generated/source.dart';
-
/**
* [InlineLocalRefactoring] implementation.
*/
-class InlineLocalRefactoringImpl extends RefactoringImpl implements
- InlineLocalRefactoring {
+class InlineLocalRefactoringImpl extends RefactoringImpl
+ implements InlineLocalRefactoring {
final SearchEngine searchEngine;
final CompilationUnit unit;
final int offset;
@@ -83,7 +82,7 @@ class InlineLocalRefactoringImpl extends RefactoringImpl implements
if (!_isVariableDeclaredInStatement()) {
result = new RefactoringStatus.fatal(
'Local variable declaration or reference must be selected '
- 'to activate this refactoring.');
+ 'to activate this refactoring.');
return new Future.value(result);
}
// should have initializer at declaration
@@ -91,8 +90,8 @@ class InlineLocalRefactoringImpl extends RefactoringImpl implements
String message = format(
"Local variable '{0}' is not initialized at declaration.",
_variableElement.displayName);
- result =
- new RefactoringStatus.fatal(message, newLocation_fromNode(_variableNode));
+ result = new RefactoringStatus.fatal(
+ message, newLocation_fromNode(_variableNode));
return new Future.value(result);
}
// prepare references
@@ -101,11 +100,11 @@ class InlineLocalRefactoringImpl extends RefactoringImpl implements
for (SearchMatch reference in _references) {
if (reference.kind != MatchKind.READ) {
String message = format(
- "Local variable '{0}' is assigned more than once.",
- [_variableElement.displayName]);
+ "Local variable '{0}' is assigned more than once.", [
+ _variableElement.displayName
+ ]);
return new RefactoringStatus.fatal(
- message,
- newLocation_fromMatch(reference));
+ message, newLocation_fromMatch(reference));
}
}
// done
@@ -117,13 +116,11 @@ class InlineLocalRefactoringImpl extends RefactoringImpl implements
SourceChange change = new SourceChange(refactoringName);
// remove declaration
{
- Statement declarationStatement =
- _variableNode.getAncestor((node) => node is VariableDeclarationStatement);
+ Statement declarationStatement = _variableNode
+ .getAncestor((node) => node is VariableDeclarationStatement);
SourceRange range = utils.getLinesRangeStatements([declarationStatement]);
doSourceChange_addElementEdit(
- change,
- unitElement,
- newSourceEdit_range(range, ''));
+ change, unitElement, newSourceEdit_range(range, ''));
}
// prepare initializer
Expression initializer = _variableNode.initializer;
@@ -168,9 +165,7 @@ class InlineLocalRefactoringImpl extends RefactoringImpl implements
}
// do replace
doSourceChange_addElementEdit(
- change,
- unitElement,
- newSourceEdit_range(range, codeForReference));
+ change, unitElement, newSourceEdit_range(range, codeForReference));
}
// done
return new Future.value(change);
@@ -194,8 +189,8 @@ class InlineLocalRefactoringImpl extends RefactoringImpl implements
return false;
}
- static bool _shouldBeExpressionInterpolation(InterpolationExpression target,
- Expression expression) {
+ static bool _shouldBeExpressionInterpolation(
+ InterpolationExpression target, Expression expression) {
TokenType targetType = target.beginToken.type;
return targetType == TokenType.STRING_INTERPOLATION_IDENTIFIER &&
expression is! SimpleIdentifier;

Powered by Google App Engine
This is Rietveld 408576698