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

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

Issue 1521883002: Fix lints: unnecessary_brace_in_string_interp (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/extract_method.dart
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
index e83082b54c262d65ca6da4146e584a5c5ddba81d..64225fcab0299f739ff60a329a7c6c7377a8d2f6 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
@@ -219,10 +219,10 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
Future<SourceChange> createChange() async {
SourceChange change = new SourceChange(refactoringName);
// replace occurrences with method invocation
- for (_Occurrence occurence in _occurrences) {
- SourceRange range = occurence.range;
+ for (_Occurrence occurrence in _occurrences) {
+ SourceRange range = occurrence.range;
// may be replacement of duplicates disabled
- if (!extractAll && !occurence.isSelection) {
+ if (!extractAll && !occurrence.isSelection) {
continue;
}
// prepare invocation source
@@ -236,7 +236,7 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
// single variable assignment / return statement
if (_returnVariableName != null) {
String occurrenceName =
- occurence._parameterOldToOccurrenceName[_returnVariableName];
+ occurrence._parameterOldToOccurrenceName[_returnVariableName];
// may be declare variable
if (!_parametersMap.containsKey(_returnVariableName)) {
if (variableType.isEmpty) {
@@ -272,7 +272,7 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
// argument name
{
String argumentName =
- occurence._parameterOldToOccurrenceName[parameter.id];
+ occurrence._parameterOldToOccurrenceName[parameter.id];
sb.write(argumentName);
}
}
@@ -307,7 +307,7 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
String returnExpressionSource = _getMethodBodySource();
// closure
if (_selectionFunctionExpression != null) {
- declarationSource = '${name}${returnExpressionSource}';
+ declarationSource = '$name$returnExpressionSource';
if (_selectionFunctionExpression.body is ExpressionFunctionBody) {
declarationSource += ';';
}
@@ -333,16 +333,16 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
declarationSource += returnExpressionSource;
if (_returnVariableName != null) {
declarationSource +=
- '${prefix} return ${_returnVariableName};$eol';
+ '$prefix return $_returnVariableName;$eol';
}
- declarationSource += '${prefix}}';
+ declarationSource += '$prefix}';
}
}
// insert declaration
if (declarationSource != null) {
int offset = _parentMember.end;
SourceEdit edit = new SourceEdit(
- offset, 0, '${eol}${eol}${prefix}${declarationSource}');
+ offset, 0, '$eol$eol$prefix$declarationSource');
doSourceChange_addElementEdit(change, unitElement, edit);
}
}

Powered by Google App Engine
This is Rietveld 408576698